Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-09-30 15:31:07

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,639
GitHub Twitter

TXP variable empty [Solved]

Sometimes variables are populated, sometimes not.

I encounter a problem with this:

<ul class="abs" id="choices"><txp:variable name="languages_counter" value="0" /><txp:section_list sort="name asc" break=""><txp:evaluate query='string-length("<txp:section />") < 3'>
		<li role="option" tabindex="<txp:variable name="languages_counter" value='<txp:evaluate query=''<txp:variable name="languages_counter" /> + 1'' />' />" class="rel"><a aria-label="" href="<txp:site_url /><txp:section />"><txp:php>echo strtoupper(section(array()));</txp:php></a></li>
</txp:evaluate></txp:section_list>
</ul>

What I need here is an incrementation into the tabindex but unfortunately they are empty.

Could you find where I fail while another sample by me works just fine (See here). Thanks.

Last edited by Pat64 (2019-09-30 17:34:50)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2019-09-30 15:46:09

etc
Developer
Registered: 2010-11-11
Posts: 5,236
Website GitHub

Re: TXP variable empty [Solved]

You don’t seem to output it, just incrementing its value. Try

<li role="option" tabindex="<txp:variable name="languages_counter" add output />" class="rel">...</li>

Offline

#3 2019-09-30 15:49:56

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,639
GitHub Twitter

Re: TXP variable empty [Solved]

:D

As always: you’re a master, Oleg!

Thank you lot (have a good evening).


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#4 2019-09-30 15:53:46

etc
Developer
Registered: 2010-11-11
Posts: 5,236
Website GitHub

Re: TXP variable empty [Solved]

Also, I would replace

<txp:php>echo strtoupper(section(array()));</txp:php>

with

<section escape="upper" />

Offline

#5 2019-09-30 17:23:40

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,639
GitHub Twitter

Re: TXP variable empty [Solved]

:D

Each day, with you, we discover some magical and hidden things with this great CMS: Textpattern!

Thank you lot again, Oleg.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#6 2019-09-30 18:41:05

etc
Developer
Registered: 2010-11-11
Posts: 5,236
Website GitHub

Re: TXP variable empty [Solved]

My pleasure :-)

Offline

Board footer

Powered by FluxBB