Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#781 2010-12-29 22:27:40

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

Re: smd_gallery: super-flexible gallery generator

Dimitri

Does this work:

<txp:smd_gallery category="?category" objectform="gallery">
	{object}
</txp:smd_gallery>

It uses an smd_gallery-specific feature of using the ? to grab stuff from various places in the current article/URL. The category name is the current ‘global’ category that is in effect for the current article (in other words ?c=cat-name or /category/cat-name in the URL). Note that this is different (at least in TXP < 4.3.0) to the image category so if you want to make the article category display the corresponding image category you need to create the same category names in both.

For more on this, and further examples of what you can now do in TXP 4.3.0 with the URL and images, see Jeff Soo’s excellent textpattern gallery demo.


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

#782 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

#783 2010-12-30 15:45:18

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#784 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

#785 2011-01-09 08:40:39

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

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

#786 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

#787 2011-01-09 09:27:57

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

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

#788 2011-01-09 17:08:21

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 256
Website

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

#789 2011-01-09 18:16:12

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

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

#790 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

#791 2011-01-09 19:16:52

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

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

#792 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

Board footer

Powered by FluxBB