Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-01-12 11:59:53

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

how to create gallery with different album ?

Currently I’m listing all the images of a category which create a general gallery like this:

<txp:if_category name="gallery">
	<h1>Photo Gallery</h1>  
	<txp:images pageby="limit"  sort="id desc" category="gallery" limit="20">
		<a href="<txp:site_url />images/<txp:image_info type="id" /><txp:image_info type="ext" />">
		<img src="<txp:site_url />images/<txp:image_info type="id" />t<txp:image_info type="ext" />" />
		</a>
	</txp:images>
	<txp:etc_pagination range="7" prev="Prev" next="Next" wraptag="ul" break="li" />
</txp:if_category />

but i need to have different albums on my gallery, more then 5 images on each album, should i create sub category for gallery or what…, so i don’t have concept of that any one please help me
Thanks

Offline

#2 2016-01-20 09:18:21

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

Re: how to create gallery with different album ?

I’ve developed three custom PHP files which has all the gallery/album functionalities
Now i don’t have the concept for integrating those files with textpattern or how to use them on my textpattern website …
any one plz has any idea what to do plz ?

Note: those files using some URLs like gallery.php?id=3, album.php?del=3, etc..

Offline

#3 2016-01-20 17:50:08

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: how to create gallery with different album ?

You have a few options. Textpattern won’t know about the contents of a separate php script that handles its images separately, so you can’t use txp tags to access the images.

If your php script produces entirely separate pages, the easiest way is to place it in a subdirectory and to style it to match the rest of the site (if that’s important to you). If you want some elements from your main txp site to appear in your gallery template, you can use something like rah_external_output to output finished code segments from txp. A typical example would be to show a dynamically created menu from txp in your gallery script’s template.

Alternatively, if your gallery script can be made to output just the relevant gallery code (i.e. without the full html head and page surroundings – and continues to function properly), you could bring it into your txp site via an iframe (or an include if it doesn’t cause page reloads). It really depends on the script.

One final alternative: if your gallery script uses its own database to store image data that is on the same server, you can use rah_swap to temporarily access the gallery database from within textpattern. You still can’t use the txp image tags (because they require image date in the txp_images database table), but you could use something like smd_query to build your own image display system from that table data. This variant can be quite effective, but requires lots of manual work. I’ve done this before to create a user search facility in txp from custom data stored in another database.

PS: etc_query also allows you traverse another site (or another site’s feed/json output) and use it in your txp site.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB