Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
if_article_image oddness
I have a simple article setup where I use both excerpts and articles. Sometimes the articles have an associated image using the image field under the article’s Advanced options, and sometimes not. When an image is used, it appears between the excerpt and article (serving as a divider for these two article parts). If the article does not have an associated image, a simple graphic bar appears instead of the image.
My conditional statement in the article form looks like this:
<txp:if_article_image>
<txp:article_image />
<txp:else />
<img src="<txp:site_url />/images/theme/divider-article.png" alt="Decoration only" />
</txp:if_article_image>
The behavior works fine, when there’s no image, the graphic bar appears as it should; however, when there’s an image, the image doesn’t show up and my rendered code looks like this, for example…
<img src="<img src="http://wion.dev/images/73.png" width="713" height="262" alt="Textpattern administration snapshot" />" alt="" />
It’s finding the image, but as you can see there seems to be a duplication of the image tag, like it’s wrapping it.
Is this a bug?
Offline
Re: if_article_image oddness
Destry wrote:
Sometimes the articles have an associated image using the image field under the article’s Advanced options,
How are you referencing the image in the article image field? From memory it should either be a direct URL to one of your images or simply the ID number of an image. The article_image tag does the rest. If you are putting an entire <img ...>
tag in your article image field that could be what’s fouling things up.
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
Re: if_article_image oddness
I’m unable to duplicate this behavior.
Code is topiary
Offline
Re: if_article_image oddness
Doh! Thanks, Bloke. The one place I didn’t double check. Instead of using just the image ID, I was using the full txp image tag with the ID.
I wonder if it would be helpful to reduce the size of that field to just 4 characters, or provide a preference where the admin could define the character size as needed. That would help make it obvious that it’s just the ID number.
Anyway, sorry for wasting your time. But thanks for the help.
Offline
#5 2009-12-29 19:51:54
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: if_article_image oddness
Destry wrote:
I wonder if it would be helpful to reduce the size of that field to just 4 characters, or provide a preference where the admin could define the character size as needed. That would help make it obvious that it’s just the ID number.
You can also enter a relative path to the image (Textbook), or – as far as I know – a full path to (for instance) an external image. So the ability to limit the character size can be useful, but could also limit your use of the article image field.
The help text could be improved though.
Offline
Re: if_article_image oddness
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
Re: if_article_image oddness
There’s a typo relatvie
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: if_article_image oddness
MattD wrote:
There’s a typo
relatvie
D’oh! Fixed, thanks.
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
#9 2009-12-30 17:33:26
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: if_article_image oddness
Bloke wrote:
Thank you :) Are translators notified of changes in the English help texts BTW? I noticed the Dutch text just says something like ‘place the URL here’ :/
Offline
Re: if_article_image oddness
Els wrote:
Are translators notified of changes in the English help texts BTW?
Not that I’m aware of. Think it’s just a simplistic system to edit the help information in English with no implied links to other languages. I could be wrong.
Given a bit of time I could look into how it’s done behind the scenes (and maybe even improve it), though perhaps someone with greater knowledge in this arena could chime in for sure before I wade through someone else’s code looking for answers!
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
Pages: 1