Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Gallerific with Current TXP image tags -- how to implement
WebmistressM wrote:
I was talking more about the converter being used as a tool to take html markup (in case of my scenario, Gallerific’s example html pages for various gallery layouts) and adapt the codes back and forth (between html and textile, as well as vice-versa).
Why would you want to convert Gallerific’s example HTML to Textile? Textile is just super simple markup language, used to format body content, not exactly something you would call HTML replacement.
It probably would be better that you didn’t save the actual HTML to articles as Textile, or similar, but used the Textpattern’s image and article tags to generate dynamic content that would also be easier to manage in long run.
Offline
#14 2011-08-17 14:18:07
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Re: Gallerific with Current TXP image tags -- how to implement
Gocom wrote:
….Why would you want to convert Gallerific’s example HTML to Textile? Textile is just super simple markup language, used to format body content, not exactly something you would call HTML replacement.
It probably would be better that you didn’t save the actual HTML to articles as Textile, or similar, but used the Textpattern’s image and article tags to generate dynamic content that would also be easier to manage in long run.
Oh, thats more for research than anything else. I do that with many languages where I want to understand syntax more than I already do. I like to take stuff and plug it in and convert it (when the two languages are convertible, that is) and see what happens. :) So, currently I can at least get some of that research in, albiet only one sided: http://textile.sitemonks.com/
Offline
#15 2011-08-17 14:24:15
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Re: Gallerific with Current TXP image tags -- how to implement
Incidentally, I just noticed this on the documentation that you linked to:
From page: http://textpattern.net/wiki/index.php?title=article_image
The image to be associated with the tag is set under the Write tab. Click “Advanced Options” and enter either the URL of the image, or the Textpattern ID (a number set by Textpattern at upload) into the Article image field. Most of the time you will use the image ID here. Note that you can only assign a single image to each article.
This suggests that I cannot create (even with the right template tags) an article based gallery slideshow because the above suggests that it only will recognize one ID at a time. Is the above information reflective of Text Pattern 4.4.1 ?
Offline
Re: Gallerific with Current TXP image tags -- how to implement
Note that you can only assign a single image to each article
While txp:article_image
may only be able to accept one ID, you can get around it with other tags or a plugin. A typical situation is to enter a comma-separated list of image ID numbers and have your page template iterate over them to construct a gallery. There are a myriad of different ways, one of which using txp:images Marc/maruchan outlined above.
TXP Builders – finely-crafted code, design and txp
Offline
#17 2011-08-17 18:33:42
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Re: Gallerific with Current TXP image tags -- how to implement
maruchan wrote:
<txp:if_article_id id="3"><!-- if we're NOT on the section landing page, and are viewing an article with ID of 3 (for example..could be any ID) -->
<txp:article>
<h1><txp:title /></h1>
<txp:if_article_image><!-- make sure images are assigned to article -->
<txp:images><!-- show all the images assigned to this article, NOTE you could also loop thru all images in this category, and forego the use of article_images -->
<img src="<txp:image_url />" alt="<txp:image_info type="alt" />" />
</txp:images>
</txp:if_article_image>
</txp:article>
</txp:if_article_id><!-- finished with content for article of ID 3 -->
<!-- you can put the other two article_id tests here; each article can have its own layout if needed -->
</txp:if_section>
<txp:if_section name="graphic-arts">
<!-- same pattern as above -->
</txp:if_section>
Im curious if this if_article type tag can help with the 1 image vs multiple if/then scenario. Basically, something that will “hide” the carousel of thumbs if the article only has one image assigned to it from the images uploaded.
Offline
#18 2011-08-17 19:09:58
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Re: Gallerific with Current TXP image tags -- how to implement
Found this hide code for an image gallery, sourced from here:
http://textpattern.net/wiki/index.php?title=Creating_a_Photoblog
<txp:if_section name="">
<txp:hide>
we're on the homepage, so display one image
</txp:hide>
<txp:article form="image" limit="1"/>
</txp:if_section>
Think I could adapt it using some sort of “less than”/“Greater than” or is this simpler than that?
Offline
Re: Gallerific with Current TXP image tags -- how to implement
I don’t think your example will help and the txp:if_article_image tag is also of limited help as it will only test if there is “something” in the field but not what it is.
What you could do is use txp:images and and txp:variable to test if there is more than one image and output your show-image / show-image-gallery code appropriately. An example (untested):
<txp:if_article_image>
<!-- the article_image field contains something -->
<txp:variable name="is_image_sequence" value='<txp:images limit="1" offset="1" break="" />' />
<!-- save the second image in a variable -->
<txp:if_variable name="is_image_sequence" value="">
<!-- variable is empty: single image code -->
<txp:else />
<!-- variable not empty: image gallery code -->
</txp:if_variable>
</txp:if_article_image>
What this does is use the offset and limit attributes to retrieve the second image in the list. If there is one, the variable will contain something, if there is no second image, the variable should be empty. You then use if_variable
to display either a single image or multiple images. BTW: this all needs to be in an individual article context so that txp:images automatically looks in the article_image field.
TXP Builders – finely-crafted code, design and txp
Offline
#20 2011-08-17 22:25:12
- WebmistressM
- Member
- Registered: 2011-08-12
- Posts: 61
Re: Gallerific with Current TXP image tags -- how to implement
<txp:if_article_image>
<txp:variable name=“is_image_sequence” value=’<txp:images limit=“1” offset=“1” break=”“ />’ />
<!— save the second image in a variable —>
<txp:if_variable name=“is_image_sequence” value=”“>
<!— provide a simple image thumbnail using the permalink for href —>
<txp:permlink><txp:article_image thumbnail=“1” /></txp:permlink>
<txp:else />
<txp:images>
<a href=”<txp:image_url />”><txp:thumbnail /></a>
</txp:images>
</txp:if_variable>
</txp:if_article_image>
***
That is in my current form, having all article images show in thumbnail form, if the article has em.
Last edited by WebmistressM (2011-08-17 22:46:55)
Offline