Textpattern CMS support forum

You are not logged in. Register | Login | Help

#941 2015-05-17 16:43:45

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: smd_gallery: super-flexible gallery generator

I suppose that category="?agrturismo" is misspelled.

Offline

#942 2015-05-18 18:28:48

pierlu
Member
Registered: 2014-08-12
Posts: 153

Re: smd_gallery: super-flexible gallery generator

Ho scritto così <txp:if_custom_field name=“galleria1”>
<div class=“fotosagra1”>
<div class=“gallerycascioinfesta”>
<h1>Alcune foto </h1>
<txp:smd_gallery category=”?agriturismo” form=“galleryart” /> </div> </div>
</txp:if_custom_field>

ma non ho nessun risultato perchè?

Offline

#943 2015-05-18 18:34:26

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: smd_gallery: super-flexible gallery generator

The category name is with or without a question mark? Or, what means that question mark?

Offline

#944 2015-05-18 19:17:49

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,249
Website

Re: smd_gallery: super-flexible gallery generator

Good catch. I think you’re right (again). It should be category="agriturismo" without a ? mark.

As an aside: smd_gallery does use question marks to denote “what is in the ?field-name of the current article”, e.g. ?article_image. A question mark before ?agriturismo means “the category written in the custom field named agriturismo”.


TXP Builders – finely-crafted code, design and txp

Offline

#945 2015-05-18 19:27:00

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: smd_gallery: super-flexible gallery generator

jakob wrote #290885:

As an aside: smd_gallery does use question marks to denote “what is in the ?field-name of the current article”, e.g. ?article_image. A question mark before ?agriturismo means “the category written in the custom field named agriturismo”.

Thanks, I never used smd_gallery and I think it isn’t necessary today with the current tags, but that doesn’t matter here.

Offline

#946 2015-05-19 08:17:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,523
Website

Re: smd_gallery: super-flexible gallery generator

GugUser wrote #290886:

I never used smd_gallery and I think it isn’t necessary today with the current tags

Thanks for helping sort out pierlu’s issue. Yes, the question marks are a little non-standard: they pre-date proper tags-in-attribute support. Nowadays, you can achieve the same thing — in the plugin or in core — albeit with a little more typing, e.g.:

<txp:images category='<txp:custom_field name="my-field-name" />' form="galleryart" />

When I did the core image tags, they were inspired by some of the more standard portions of smd_gallery, so you’re right that the plugin is only useful if you’re doing some really wacky stuff with counts, pagination, custom combos and so forth. Such things would be a lot more difficult with native tags.


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

#947 2015-05-19 12:54:33

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: smd_gallery: super-flexible gallery generator

Hi Bloke. I appreciate your plugins very (at what position should be “very”? :-) ). My comment was not against this plugin, just I never needed it. Thanks for all you good und helpful work.

Last edited by GugUser (2015-05-19 12:55:36)

Offline

#948 2018-02-25 18:52:47

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: smd_gallery: super-flexible gallery generator

Hi,

I’m trying to either display a gallery of 4 images cycling or a static image if one has been associated with the current article. That part works.

However I also want to display only images from a sub-category if we’re on a category page. I named the sub-categories ‘headers-norway’, ‘headers-iceland’, ‘headers-india’ etc. relating to the article categories ‘norway’, ‘iceland’, ‘india’ hoping I could call them using something like this:

<txp:smd_gallery category='headers-"<txp:category />"' sublevel="1" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
			<img src="{url}" alt="{alt}" width="960" height="400" />
	</txp:smd_gallery>

… in an attempt to merge the literal 'headers-' with the output of <txp:category /> but no output is generated.

I’d be very grateful for any help :)

I pasted the full code below.

<txp:if_individual_article>
	<txp:if_custom_field name="header-image">
		<div id="header-image">
			<txp:article>
				<txp:image id='<txp:custom_field name="header-image" />' />
			</txp:article>
		</div>
	<txp:else />
		<txp:smd_gallery category='header-slideshows' sublevel="all" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
			<img src="{url}" alt="{alt}" width="960" height="400" />
		</txp:smd_gallery>
	</txp:if_custom_field>
<txp:else />
	<txp:if_category>
		<txp:smd_gallery category='headers-"<txp:category />"' sublevel="1" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
			<img src="{url}" alt="{alt}" width="960" height="400" />
		</txp:smd_gallery>
	<txp:else />
		<txp:smd_gallery category='header-slideshows' sublevel="all" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
			<img src="{url}" alt="{alt}" width="960" height="400" />
		</txp:smd_gallery>
	</txp:if_category>
</txp:if_individual_article>

Offline

#949 2018-02-26 05:47:21

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,047
Website

Re: smd_gallery: super-flexible gallery generator

Hi masa,

I normally use native tags and never used this plugin but try.

<txp:smd_gallery category='headers-<txp:category />' sublevel="1" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
		<img src="{url}" alt="{alt}" width="960" height="400" />
</txp:smd_gallery>

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#950 2018-02-26 05:53:45

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,047
Website

Re: smd_gallery: super-flexible gallery generator

some corrections in the full code too:

<txp:if_individual_article>
	<txp:if_custom_field name="header-image">
		<div id="header-image">
			<txp:article>
				<txp:image id='<txp:custom_field name="header-image" />' />
			</txp:article>
		</div>
	<txp:else />
		<txp:smd_gallery category="header-slideshows" sublevel="all" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
			<img src="{url}" alt="{alt}" width="960" height="400" />
		</txp:smd_gallery>
	</txp:if_custom_field>
<txp:else />
	<txp:if_category>
		<txp:smd_gallery category='headers-<txp:category />' sublevel="1" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
			<img src="{url}" alt="{alt}" width="960" height="400" />
		</txp:smd_gallery>
	<txp:else />
		<txp:smd_gallery category="header-slideshows" sublevel="all" limit="4" sort="random" wraptag="div" html_id="header-slideshow">
			<img src="{url}" alt="{alt}" width="960" height="400" />
		</txp:smd_gallery>
	</txp:if_category>
</txp:if_individual_article>

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

Board footer

Powered by FluxBB