Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-28 00:48:33

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Suffixing an ID with a txp-tag

For my stylesheets I need to automatically create certain elements’ IDs. This is rather simple, I just put a valid tag into the ID’s quotation marks: done!
But this time I need a concatenation of two txp tags. The result is a correct and valid ID, exactly the one I expected, but txp puts an “error_article_context on line 1821” message upon the page. [EDIT: the error appears when no concatenation takes place because the second tag isn’t used/remains empty. There is no error on those pages where the concatenation happens.] Isn’t there a way to circumvent this? Or is there perhaps another way to validly combine the section name and another predefined fixed value?
Any help is greatly appreciated. TIA
Uli

Last edited by uli (2007-05-28 01:13:13)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#2 2007-05-28 03:24:27

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Suffixing an ID with a txp-tag

Update your installed language(s).

FAQ: Article tags cannot be used outside an article context

Offline

#3 2007-05-28 12:24:38

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Suffixing an ID with a txp-tag

Update your installed language(s).

For better error messages?

FAQ: Article tags cannot be used outside an article context

As I wrote: It works fine on those pages where the two tags’ values are concatenated.
But as txp:section alone is valid in the body’s ID, I need a method to open an article into a certain section by clicking on the article’s thumbnail.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#4 2007-05-28 18:54:34

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: Suffixing an ID with a txp-tag

I need a method to open an article into a certain section by clicking on the article’s thumbnail

As far as I am aware, an article itself will open in the section you set it to appear in. You can, however, list articles from other sections using txp:article_custom together with limit="1" to make only one appear, or id="123" to make one specific article appear outside it’s normal section. Maybe you need to rethink how you have your articles organised (perhaps categories instead of sections)?

Isn’t there a way to circumvent this? Or is there perhaps another way to validly combine the section name and another predefined fixed value?

I found it difficult to follow your question. Can you say what output you want to achieve in each situation? (i.e. for a section frontpage body id="{section}", for an article page body id="{section}_{url}" or whatever…)


TXP Builders – finely-crafted code, design and txp

Offline

#5 2007-05-28 23:56:47

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Suffixing an ID with a txp-tag

I found it difficult to follow your question. Can you say what output you want to achieve in each situation? (i.e. for a section frontpage body id="{section}", for an article page body id="{section}_{url}" or whatever…)

Thank you for offering your help. Yes, what you wrote is pretty close to what I want to achieve.
I’m setting up a gallery. On the page where all the thumbnails live I needed the section name as the body’s ID. On the article page (single image view, single article) I needed another, yet predictable ID for the body in order to give this page a different style. But this seems solved: In the forum I found that the error I got is only displayed in test mode and that it does no harm. So, actually everything works like it should: I now use txp:keywords to suffix the ID, and it works perfectly.

But if you know a way to open the single image view/single article page in a new window with predefined sizes (not a new tab), then please let me know.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#6 2007-05-29 00:33:56

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Suffixing an ID with a txp-tag

For better error messages?

Yes. The FAQ I posted explains why you’re getting the error message you quoted and what you can do about it.

Offline

#7 2007-05-29 13:58:50

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: Suffixing an ID with a txp-tag

I now use txp:keywords to suffix the ID, and it works perfectly.

If it doesn’t have to different for each image/article, then name the if_article_list view body id="{section}_overview" and the individual_article just body id="{section}".

But if you know a way to open the single image view/single article page in a new window with predefined sizes (not a new tab), then please let me know.

If it’s just for the images there are a number of good gallery plug-ins that will pop-up windows with or without caption. Also I think with the thickbox in-line pop-ups you can open entire other html pages in thickbox windows, though I’ve not tried it from within txp.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2007-05-29 15:35:36

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Suffixing an ID with a txp-tag

If it’s just for the images there are a number of good gallery plug-ins that will pop-up windows with or without caption. Also I think with the thickbox in-line pop-ups you can open entire other html pages in thickbox windows, though I’ve not tried it from within txp.

I’ve looked around the forum and at textpattern.org over several months for solutions, but all I could find were mere image displays plus captions whereas I also need some HTML. Johan Nilsson has written some code that opens windows of predefined sizes, but it creates only text links.

So thanks for mentioning thickbox, I’ll definitely give it a try. It’s less puzzling for untrained users than a new tab that’s covering the previous content completely. The drawback is it won’t work in browsers more than 4-5 years old.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB