Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [SOLVED] image gallery & article custom
maniqui wrote:
You could narrow the query by adding…
Hi Julián,
here i am showing my ignorance:) Is this what you mean?
<txp:smd_gallery limit="999" escape="">
<txp:smd_query column="*" table="textpattern" break=""
where='
custom_6 LIKE "{id}"
OR custom_6 LIKE "%,{id},%"
OR custom_6 LIKE "%,{id}"
OR custom_6 LIKE "{id},%"
where'
section="events"
OR section="participations"
OR section="about"
AND status=4'
>
<div class="line">
<txp:permlink><txp:image id="{id}" alt="{alt}" title="{alt}" class="grid_6" /></txp:permlink>
<div class="grid_17 prefix_1">{caption}</div>
<div class="clear"> </div></div>
</txp:smd_query>
</txp:smd_gallery>
Last edited by colak (2012-08-08 15:05:49)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] image gallery & article custom
Yiannis, sorry, me being lazy.
This is what I meant:
<txp:smd_gallery limit="999" escape="">
<txp:smd_query column="*" table="textpattern" break=""
where='
section="events"
OR section="participations"
OR section="about"
AND (
custom_6 LIKE "{id}"
OR custom_6 LIKE "%,{id},%"
OR custom_6 LIKE "%,{id}"
OR custom_6 LIKE "{id},%"
)
AND status=4'
>
<div class="line">
<txp:permlink><txp:image id="{id}" alt="{alt}" title="{alt}" class="grid_6" /></txp:permlink>
<div class="grid_17 prefix_1">{caption}</div>
<div class="clear"> </div></div>
</txp:smd_query>
</txp:smd_gallery>
Offline
Re: [SOLVED] image gallery & article custom
This returns a lot of <div class="line">...</div> and some places where the images do not display but their captions do. Again there are multiple instances of the sets.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] image gallery & article custom
i solved it. The solution is not as automated as I would have liked but it works. It uses the image name field as part of the url. Here is the code should anybody wants to use it and here it is in action
<txp:variable name="otherpubs"
value='<txp:article_custom section="events, participations, about" limit="999" break=",">
<txp:if_custom_field name="pubs_by_others">
<txp:custom_field name="pubs_by_others" />
</txp:if_custom_field>
</txp:article_custom>'
/> <txp:hide>collect all image ids from the custom_fields into a variable</txp:hide>
<txp:if_variable name="otherpubs">
<txp:images id='<txp:variable name="otherpubs" />' sort="id desc" limit="999"><txp:hide>the variable is used to collate the image ids and sort them</txp:hide>
<txp:if_different><txp:hide>omit any duplicate ids</txp:hide>
<div class="line">
<a href="<txp:site_url /><txp:image_info type="name" />"><txp:hide>link to the required pages using the image name field</txp:hide>
<img src="<txp:site_url />images/<txp:image_info type="id" />
<txp:image_info type="ext" />" alt="<txp:image_info type="alt" />"
title="<txp:image_info type="alt" />"
width="<txp:image_info type="w" />"
height="<txp:image_info type="h" />" class="grid_6"
id="a<txp:image_info type="id" /> "/></a>
<div class="grid_17 prefix_1"><txp:image_info type="caption" escape="" /></div><txp:hide>image caption with html content</txp:hide>
<div class="clear"> </div>
</div>
</txp:if_different>
</txp:images>
</txp:if_variable>
> Edit: for existing sites it might be easier to use <txp:images id='<txp:variable name="otherpubs" />' sort="alt desc" limit="999"> instead of <txp:images id='<txp:variable name="otherpubs" />' sort="id desc" limit="999">
Last edited by colak (2012-08-10 04:31:50)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline