Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2020-02-28 13:40:04

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,269
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

amordecosmos wrote #321978:

Am I crazy or is <txp:variable /> no longer global?

I have a fresh install and <txp:variable /> will work on page that it is initiated but won’t work on a different page.

It’s me, right?

Could you tell us more about how you use it? Maybe post your snippet here?


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#12 2020-02-28 13:40:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,714
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

amordecosmos wrote #321978:

Am I crazy or is <txp:variable /> no longer global?

It’s never been global, has it? You need to ‘include’ your variable definition on every page in which it’s used. If I need a set variable, I add it then in a Form and use <txp:output_form /> to include it where I need it.

Unless I’ve misunderstood your question.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#13 2020-02-28 14:04:49

amordecosmos
Member
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 71
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

I may have been using it wrong in the past. But it worked, so maybe it was a bug that is now corrected.

But I would do something like <txp:variable name = ‘previous_page’ value = ‘<txp:permlink />’ />

Then somewhere else, I could do ‘Go back to <txp:variable name =“previous_page”/>’

(Obvs not correct linking code)

But the <txp:variable name =“previous_page”/> is now empty on a different page.

Offline

#14 2020-02-28 14:12:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,269
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

Try

<txp:variable name="previous_page" value='<txp:permlink />' />

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#15 2020-02-28 14:26:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,714
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

Hmmm, the approach works for me. In the default form, for example:

<txp:variable name="previous_page"><txp:link_to_prev /></txp:variable>
Go back to <a href="<txp:variable name="previous_page" />">Previous page</a>

If I click on the link, it jumps back an article at a time.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#16 2020-02-28 14:49:50

amordecosmos
Member
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 71
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

It doesn’t work. That’s what is so weird.

If I do <txp:variable name=“previous_page” value=’<txp:permlink />’ />
Then immediately do <txp:variable name=“previous_page” /> it is correct.

But if I put <txp:variable name=“previous_page” /> on a different page, it’s empty.

But was I always doing it wrong? Should it be done in forms?

Offline

#17 2020-02-28 15:19:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,269
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

amordecosmos wrote #321986:

But if I put <txp:variable name="previous_page" /> on a different page, it’s empty.

By different page I take it that you mean txp page (template). It would not work like this as variables should be in all pages that make use of them. If it was working before it was definitely a bug.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#18 2020-02-28 16:35:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,714
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

amordecosmos wrote #321986:

if I put <txp:variable name=“previous_page” /> on a different page, it’s empty.

If it worked this way before, it was definitely a bug. There’s no variable state remembered from page to page. You need to treat each request as a discrete event and set everything you might need on it at the start of the page flow.

Sorry for the inconvenience if it really did work this way before: honestly never noticed.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#19 2020-02-28 19:27:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,786
Website

Re: Feedback to: Textpattern CMS 4.8.0 Released

Cheers for all the hard work, chaps.

Just pre-flighting an upgrade, and noticed that css.php and .htaccess in sites/site1/public have not been updated to correspond to the changes in their top-level counterparts, and it looks to me as though they should.


Code is topiary

Offline

#20 2020-03-01 15:01:46

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 3,129

Re: Feedback to: Textpattern CMS 4.8.0 Released

jsoo wrote #321993:

Just pre-flighting an upgrade, and noticed that css.php and .htaccess in sites/site1/public have not been updated to correspond to the changes in their top-level counterparts, and it looks to me as though they should.

Hi Jeff – I think this is now done in dev, should be released with 4.8.1.

Last edited by gaekwad (2020-03-02 14:06:01)

Offline

Board footer

Powered by FluxBB