Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-02-02 10:52:44

Gallex
Member
Registered: 2006-10-08
Posts: 1,287

tag error

Textpattern version: 4.8.7
PHP version: 7.4.27

i use custom field to display image for albums list page
as you can see all displaying correctly in live mode, but in debugging mode i get error:

Tag error: <txp:image id='<txp:custom_field name="gallery" />' /> ->  Textpattern Notice: Unknown image while parsing form galerii on page default_est
textpattern/lib/txplib_misc.php:726 trigger_error()
textpattern/publish/taghandlers.php:409 imageFetchInfo()
thumbnail()
textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func()
textpattern/lib/txplib_publish.php:544 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:406 processTags()
textpattern/publish/taghandlers.php:4445 parse()
if_custom_field()
textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func()
textpattern/lib/txplib_publish.php:544 Textpattern\Tag\Registry->process()

something is wrong here – <txp:image id='<txp:custom_field name="gallery" />' />

my gallery form:

<txp:if_article_list>
<div class="album">
<txp:permlink>
<txp:if_custom_field name="gallery">
<txp:image id='<txp:custom_field name="gallery" />' />
<txp:else />
<txp:article_image />
</txp:if_custom_field>
</txp:permlink>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
</div>
<txp:else />
<h1><txp:title /></h1>
<txp:body />
<txp:if_article_image><txp:images auto_detect="article" form="article_album"  wraptag="ul" break="li" class="article-album" /></txp:if_article_image>
</txp:if_article_list>

Last edited by Gallex (2022-02-02 11:30:14)

Offline

#2 2022-02-02 12:35:44

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,522
Website GitHub Twitter

Re: tag error

Hi

I suspect you have one article that dont have a correct image id set, check on the backend how many articles are on the gallery section.

Cheers.

Offline

#3 2022-02-02 16:33:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,002
Website GitHub Mastodon Twitter

Re: tag error

If you use more than one image id in the article_image field try changing <txp:if_article_image><txp:images auto_detect="article" form="article_album" wraptag="ul" break="li" class="article-album" /></txp:if_article_image> to <txp:if_custom_field name="article_image"><txp:images auto_detect="article" form="article_album" wraptag="ul" break="li" class="article-album" /></txp:if_custom_field>.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2022-02-02 16:55:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,206
Website GitHub

Re: tag error

colak wrote #332604:

If you use more than one image id

Does that change things? I thought that <txp:if_article_image> tested if there was anything in the Article Image field. And in this context, <txp:if_custom_field> should do the same: detects if the field has any content at all. Ummm, I think.

The only time it’ll make a difference is if you’re trying to compare the article image contents to something (or to compare it using a separator string, pattern match, etc). The <txp:if_article_image> test doesn’t do any of that – it’s just a boolean “does the field contain stuff or not?”. The <txp:if_custom_field> does the same without any other parameters… at least, it should behave that way.


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

#5 2022-02-03 10:05:53

Gallex
Member
Registered: 2006-10-08
Posts: 1,287

Re: tag error

Dragondz wrote #332587:

Hi

I suspect you have one article that dont have a correct image id set, check on the backend how many articles are on the gallery section.

you were absolutely right, there was a typo on ID field! :)

Offline

#6 2022-02-03 11:41:32

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,522
Website GitHub Twitter

Re: tag error

Gallex wrote

you were absolutely right, there was a typo on ID field! :)

Got same problem a while back with image deleted on server but not on article_image field.

Offline

Board footer

Powered by FluxBB