Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-01-08 15:21:12

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Image Gallery / Content Slider

bloke…..trying out your gallery plugin but im getting an error. im using the current version of textpattern. amd i doing something wrong?

error was…
A problem occured while loading the plugin: smd_gallery -> User_Error: Unable to include required plugin “smd_lib” on line 498

Fatal error: Class ‘smd_MLP’ not found in /Applications/MAMP/htdocs/txp/textpattern/lib/txplib_misc.php(594) : eval()’d code on line 11

-cw

Last edited by CodeWalker (2010-01-08 15:22:24)

Offline

#14 2010-01-08 15:42:44

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

Re: Image Gallery / Content Slider

CodeWalker wrote:

Unable to include required plugin “smd_lib”

Try installing and activating smd_lib ; a required component of smd_gallery :-)

Last edited by Bloke (2010-01-08 15:43:20)


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

#15 2010-01-08 15:44:55

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Image Gallery / Content Slider

Im making progress, ive now got wet_for_each_image populating both the slides with images and corresponding thumbnails within the pagination list. next step is to get it working with a custom feild.

more news later..

-cw

Offline

#16 2010-01-08 15:46:54

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Image Gallery / Content Slider

Bloke wrote:

CodeWalker wrote:

Unable to include required plugin “smd_lib”

Try installing and activating smd_lib ; a required component of smd_gallery :-)

of course! silly me.

Offline

#17 2010-01-08 16:12:59

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Image Gallery / Content Slider

Bloke wrote:

EDIT: Els, do you think the general flow I proposed above makes sense? Any better ideas? Any thoughts on how to put HTML into the mix as well?

I admit I’m not sure what the exact outcome should be, but if the output should only be either one of image, video or html/text, the simplest way in my opinion is to use articles that have either an article image assigned, or a custom field for the video, or the excerpt for the html. Then use conditionals (if_article_image, if_custom_field, if_excerpt, maybe even if_variable) to determine which one is needed.

CodeWalker’s setup may well be far more complicated than this; still the right mix of variable and if_variable tags can achieve an awful lot… ;)

Offline

#18 2010-01-08 16:32:06

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Image Gallery / Content Slider

actually you have just made me realise something. There may be a really rare occassion when i only have one image or one excerpt or one video to display. in the this case, the whole slider setup would be totally wasted.

How, if there is a way, do i get it to check. Can i somehow count the number of images in category and if theres more than one, use form_slider, if theres just one image in the category use form_single_image instead?

im not huge programmer, aside from a very basic grasp of PHP. if theres a better way, then please share :)

so heres wot needs to happen

check for more than one image in a category

-> if so, list them in the slider with form_image_cat_list ->then check for videos and list those aswell with form_video_cat_list
-> if there are no images, check for a video in the downloads catagory and list those in the slider if theres more than one by outputting form_video_cat_list
-> if only one video exists, output form_single_video.

-> if there are no videos or images -> output form_excerpt_only

Does this make sense? im sure its just a bunch of if else statements but i rly dont know how.

Many thanks.

Last edited by CodeWalker (2010-01-08 16:45:47)

Offline

#19 2010-01-08 16:57:59

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Image Gallery / Content Slider

Where do you fetch the (images and files) category name? Is it the same category as the article is in? Is it in a custom field?

Last edited by els (2010-01-08 16:58:17)

Offline

#20 2010-01-08 17:02:18

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Image Gallery / Content Slider

ok, Bloke suggested setting the image and videos (via the downloadlinks) catagories to same name so that way i can set that in a custom field to populate the slider with both video and images with a single custom feild.

Make sense?

Offline

#21 2010-01-08 17:08:51

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Image Gallery / Content Slider

CodeWalker wrote:

Make sense?

Yes :) To figure out how to check for the number of images in a category, can you tell me which plugin you are using now, wet_for_each_image or smd_gallery? I haven’t used smd_gallery myself, so you’d have to tell me what the tag you are using to display the images looks like.

Offline

#22 2010-01-08 17:09:13

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Image Gallery / Content Slider

would it be simpler to do it the other way round, instead of checking the number of image? as in, use a single image or video by defualt and if theres a value in the custom field then go ahead and use the slider instead?

that seams more elegant to me.

so if custom feild has a value, output slider_form using custom value to pull in images and video from a named catagory, else output form_single_image.

my previous idea might be goood try aswell tho, just so i can see how both work in practice.

im using wet_for_each_image

Last edited by CodeWalker (2010-01-08 17:11:00)

Offline

#23 2010-01-08 17:29:22

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Image Gallery / Content Slider

Before I read your last post (so maybe you won’t need this after all), I came up with something like the example below. It’s just a raw idea, you might need to tweak it a little, change the order, or whatever, but it gives you an idea of how to check for content. I have to go out now, so if you have any questions about it you’ll have to figure it out yourself or wait for someone else to explain it ;)

<txp:variable name="any_images" value='<txp:wet_for_each_image category=''<txp:custom_field name="nameofcustomfield" />'' />' limit="1" />
<txp:variable name="mt1_images" value='<txp:wet_for_each_image category=''<txp:custom_field name="nameofcustomfield" />'' />' offset="1" limit="1" />
<txp:variable name="any_videos" value='<txp:file_download_list category=''<txp:custom_field name="nameofcustomfield" />'' limit="1" />
<txp:variable name="mt1_videos" value='<txp:file_download_list category=''<txp:custom_field name="nameofcustomfield" />'' offset="1" limit="1" />

<txp:if_variable name="any_images" value="">
	//no images, check for videos
	<txp:if_variable name="any_videos" value="">
		// no videos, check for excerpt
		<txp:if_excerpt>
			// call form_excerpt_only
		</txp:if_excerpt>
	<txp:else />
		<txp:if_variable name="mt1_videos" value="">
			// only one video
			// call form_single_video
		<txp:else />
			// more than one video
			// call form_video_cat_list
		</txp:if_variable>
	</txp:if_variable>
<txp:else />
	<txp:if_variable name="mt1_images" value="">
		// only one image
		// call form_single_image
	<txp:else />
		// more than one image
		// call form_slider
	</txp:if_variable>
</txp:if_variable>

Last edited by els (2010-01-08 17:30:14)

Offline

#24 2010-01-08 17:53:48

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Image Gallery / Content Slider

thanks Els, that looks helpful. Hope you have fun out.

ill give it a go and see how far i get.

CHeers :)

Offline

Board footer

Powered by FluxBB