Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#781 2010-12-30 15:35:20
- Dimitri
- Member

- From: Johannesburg
- Registered: 2010-10-31
- Posts: 129
Re: smd_gallery: super-flexible gallery generator
Hi
No it doesnt work.
<txp:smd_gallery category="?category" objectform="gallery">
{object}
</txp:smd_gallery>
It would be great if I was able to do this category="<txp:category />"
I am also trying out the 4.3 core tags but the funny thing is I achieved what i want with this
<txp:image_index />
<txp:image_display /> but it is limited
The link you gave me to the Jeff Soo gallery, its great but it’s a very bad doc. The javascript code is missing, tried copy it off from the source code and it wont work. Also <txp:image_list /> is outdated but i know it had been changed to <txp:images />
but I need you to tell me how to do this, just any example
if I am on the url like this
localhost/galley/?c=album1
localhost/galley/?c=album2
localhost/galley/?c=album3
I want to use the tag something like this
<txp:images category=”???” /> how can I make the category auto-detect the name of the category and display it, I have tried auto_detect=“images”, no clue what it is for.
Do I have to use < variable /> or something
Thanx
****
My point is, I need to make this flexible, the client must be able to create many categories as they like, the code had to be flexible so I dont have to keep coming back to code for them.
Last edited by Dimitri (2010-12-30 15:42:20)
<txp:way_too_cool />
Offline
#782 2010-12-30 15:45:18
Re: smd_gallery: super-flexible gallery generator
You can do: category="<txp:category />"
But you have to do it this way: category='<txp:category />'
When nesting TXP tags in TXP tags, you have to escape the quotes by using single quotes.
Offline
#783 2010-12-30 15:49:03
- Dimitri
- Member

- From: Johannesburg
- Registered: 2010-10-31
- Posts: 129
Re: smd_gallery: super-flexible gallery generator
Bro, you came from nowhere to save me from 4 days of stress, I cant thank you enough.
I will get that in mind.
<txp:way_too_cool />
Offline
#784 2011-01-09 08:40:39
Re: smd_gallery: super-flexible gallery generator
I’m trying
<txp:smd_gallery category="animals" sublevel="all" limit="1" sort="random">
<a href="<txp:site_url />{title}"><img src="{url}" alt="{alt}" /></a>
</txp:smd_gallery>
but the {title} attribute is not parsed. What I get is a link to the site url.
Can anybody spot what’s wrong with my code?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#785 2011-01-09 09:16:17
- Dimitri
- Member

- From: Johannesburg
- Registered: 2010-10-31
- Posts: 129
Re: smd_gallery: super-flexible gallery generator
Hi colak.
{title} is for displaying the image caption. From when you upload the image, and you add some texts in the “Caption” textarea
I dont know what you are trying to achieve with your code. Try something like this, to open the image to an new window.
<txp:smd_gallery category="animals" sublevel="all" limit="1" sort="random">
<a href="{url}"><img src="{url}" alt="{alt}" /></a>
<p>{title}</p>
</txp:smd_gallery>
Last edited by Dimitri (2011-01-09 09:18:24)
<txp:way_too_cool />
Offline
#786 2011-01-09 09:27:57
Re: smd_gallery: super-flexible gallery generator
Hi dimitri,
Thanks for the reply
I am trying to link the image to a particular page not to itself.
What I expected to get is
<a href="http://mysite.tld/title"><img src="images/x.jpg" alt="my alt tag" width="230" height="300" /></a>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#787 2011-01-09 17:08:21
Re: smd_gallery: super-flexible gallery generator
colak wrote:
I am trying to link the image to a particular page not to itself.
What I expected to get is
<a href="http://mysite.tld/title"><img src="images/x.jpg" alt="my alt tag" width="230" height="300" /></a>
Shouldn’t it work with <txp:article_url_title /> since you’re calling the gallery from within an article?
…Prrrrrrrr…
Offline
#788 2011-01-09 18:16:12
Re: smd_gallery: super-flexible gallery generator
TNT wrote:
Shouldn’t it work with
<txp:article_url_title />since you’re calling the gallery from within an article?
I’m not. I’m calling it from within a template. But I still don’t understand why {title} is not parsed.
Last edited by colak (2011-01-09 18:17:22)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#789 2011-01-09 18:21:34
- Dimitri
- Member

- From: Johannesburg
- Registered: 2010-10-31
- Posts: 129
Re: smd_gallery: super-flexible gallery generator
Like I said in my previous post, {title} merely outputs the text. It definitely will not work if you try make a link with this attribute.
<txp:way_too_cool />
Offline
#790 2011-01-09 19:16:52
Re: smd_gallery: super-flexible gallery generator
well the strange thing is that it seems that it is not parsed at all even when I use
<txp:smd_gallery category="animals" sublevel="all" limit="1" sort="random">
<txp:image id="{id}" />
<br />{title}
</txp:smd_gallery>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#791 2011-01-09 22:09:40
- Dimitri
- Member

- From: Johannesburg
- Registered: 2010-10-31
- Posts: 129
Re: smd_gallery: super-flexible gallery generator
Make sure when you upload an image in the backend, you must add some texts in the “Caption” textarea.
It will be parsed, also wrap it around in <p> for the CSS.
<txp:way_too_cool />
Offline
#792 2011-01-09 22:19:08
Re: smd_gallery: super-flexible gallery generator
colak wrote:
well the strange thing is that it seems that it is not parsed at all even when I use
When you say ‘not parsed’, you mean that you see the actual string {title} in the HTML output? That is weird. Do any of the other smd_gallery {} substitutions get replaced with their equivalents? As Dimitri says, since smd_gallery v0.50, {caption} and {title} mean the same thing.
In your latest example, do you see images but no captions? What does the rendered HTML look like? Do you just see:
<img src="some_image" />
<br />
<img src="some_other_image" />
<br />
...
? I admit I don’t quite get what you’re doing. Are you uploading images and setting the image Caption to the url_title of an article so you can link to an article from an image?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#793 2011-01-10 06:59:11
Re: smd_gallery: super-flexible gallery generator
Hi Stef
No I do not see {title} in the HTML output. I have been an idiot. It is image {name} i had to use. Here is my final working code. Somehow I just couldn’t see it yesterday.
<txp:smd_gallery category="animals" sublevel="all" limit="1" sort="random">
<a href="<txp:site_url />{name}"><txp:image id="{id}" /></a>
</txp:smd_gallery>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#794 2011-02-02 19:02:50
Re: smd_gallery: super-flexible gallery generator
Hello Stef,
I try to start a slimbox2 gallery from one image, that should be shown in fullsize, but I only get a thumbnail as start. As far as I understand it, I have to set thumb whether to "0" or to "0:0", but neither one of these options works. In the other direction, setting both to thumbnailsize, it works.
Here is my smd_gallery tag
<txp:smd_gallery form="equipment_bild" id="?article_image" class="artikel_bild" sort="random" thumblimit="1" thumb="0" />
this is the form
<a rel="lightbox-smd" href="{url}" title="{caption}">{object}</a>
Where to look?
Thanks …
Offline
#795 2011-02-02 20:21:40
Re: smd_gallery: super-flexible gallery generator
whocarez wrote:
As far as I understand it, I have to set
thumbwhether to"0"or to"0:0", but neither one of these options works.
Ah, I think you’ve found a couple of bugs — or at least some inconsistencies which I need to address that are holdovers from versions released prior to TXP 4.2.0.
Firstly, the documentation is wrong (or the code is bugged) when it comes to single values in the thumb attribute. For reasons I cannot fathom I’m always setting the thumbnail size to the ‘t’ image if you use a single value. Stupid. So in order to set both images to the full size, you do need to specify thumb="0:0".
Secondly, it is actually working and displaying your full size image but the {object} tag doesn’t take into account the fact you’re using the full size image so it puts the thumbnail width and height into the <img> tag. Hence your images are full size but the browser is scaling them to the dimensions of the thumbs. D’oh!
The easiest way round this is to use thumbsize="200, 300" (or whatever your full size image dimensions are) to force the browser to use those sizes. Or you can build your own {object} img tag via objectform and put the dimensions in there.
I’ll have to see if I can fix these behaviour issues. Thanks for finding them and sorry the plugin was a whole heap of FAIL for you.
Last edited by Bloke (2011-02-02 20:22:10)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline