Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-07-03 21:01:37

jag
Member
Registered: 2006-07-01
Posts: 10

Re: static page in section or subsection

Hi,
I wouldn’t actually be using multiple pages per photo since the script has them all running from the same page practically. However I suppose it would be interetsing to have another version that just displays the photo alone that may be possible by as you say creating an ‘article’ per photo for browsers that have JavaScript turned off and being more user friendly for the small percentage that don’t have JavaScript turned on.
But since I can’t seem to get one page done properly yet apart from main sections then this is not really an option LOL ;)

John

PS : Thanks Mary for the info :)

Last edited by jag (2006-07-03 21:02:02)

Offline

#14 2006-07-03 21:06:41

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

Re: static page in section or subsection

Mary wrote:

Handcoding will only be needed temporarily too: linking to a section from category links is a feature added in svn, so it will be in 4.0.4. :)

Now that is a nice thing to hear! Thanks Mary!

Offline

#15 2006-07-03 21:40:27

jag
Member
Registered: 2006-07-01
Posts: 10

Re: static page in section or subsection

Hi,

Well I’m not getting it here at all. If I create an article and say that I want it in the section ‘photos’ and I then assign a category ‘photos_professional’ I don’t see how from there I can define the page layout that is different to the photos page and has specific JavaScript code that is also different to the photos page…

I think it will be a lot faster for me to just get the plug-in to work with sections looking like subsections or just do the site in static mode !

John

Offline

#16 2006-07-03 22:27:24

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,126
Website GitHub

Re: static page in section or subsection

jag, you have two principal choices and with it two types of categories to choose between, article-categories or image-categories:

1. You use image categories and one of the gallery plug-ins that displays images by image category, for instance rss_thumbpop. You create image categories for each photo category in the content / organise area. Then when you upload your photos, you assign them to a category.

With this method, one article = an entire gallery, e.g. you create an article called “professional” and assign it to section “photos”. In it you write what you want as introductory blurb for the gallery.

In your page template you use txp:article with a listform=“myalbums” (which is used for list view) to list the articles (your gallery overview) and a form=“mygallery”, which is used for the article (gallery) content (txp:body). In if_individual_article you then append rss_thumbpop (or similar) to display photos by category. See the instructions for that at wilshireone.com or in the plug-ins forum (search). Every time you add a photo and assign it to that image category, then it will appear in your gallery. Your URL link looks like mysite.com/photos/professional

Pros: Images need only be uploaded and assigned to category. Cons: You are limited to the alt and caption fields. You cannot write any more about the photo or have people comment on it. You can bookmark/link to your gallery, but not to each picture.

2. You use article categories together with one of the article thumbnail plug-ins. First you set up two (or more) article categories in the content/organise area, e.g. “professional” and “photos”.

In this setup each article = 1 photo. You upload the photo in the image area first, then you write an article with its own title, a description of the photo if desired etc. You put the ID of your previously uploaded image in the article-image field. Finally you assign the article to the section “photos” and the category “professional” or “travel” etc. This is typical of photoblog setups, so that people can comment on each image individually.

In your page template, you use the if_article_list, if_category and if_individual_article conditional tags in combination. In if_article_list you present a choice of categories, in if_category, you use one of the plug-ins (wet_article_thumbs…) to produce a thumbnail view of all your photoblog articles. In if_individual articles you present the article with the large scale image.

Out of the box your url looks like mysite.com/photos/?c=category. If you have fixed category names you can use mod_rewrite in your htaccess file to make /professional translate to ?c=professional and so also have mysite.com/photos/professional/ Not that, such rewrite rules have to made for every new category you make and you should not create any articles with the same name or they will conflict.

Pros: you can have detailed reactions to each image, design different forms for how articles are to be displayed etc. You can have a permlink for each photo. Cons: there are several more steps to adding a photo.

Your choice may depend upon exactly what you’re trying to achieve with the javascript. Perhaps you can say some more about that or link to an example which uses it.

For your blog area, you use a different page template and assign the articles you write to your “blog” section.

Last edited by jakob (2006-07-03 22:28:49)


TXP Builders – finely-crafted code, design and txp

Offline

#17 2006-07-03 23:05:41

jag
Member
Registered: 2006-07-01
Posts: 10

Re: static page in section or subsection

Hi Jakob,

Wow that is a very detailed piece there. I see how the slideshow would be obtained this way and seems very interesting. This is a link to the javascript/AJAX gallery I’m using from couloir.org

As you can see everything is handled in one page, each gallery of several photos is in one page and I would like to create say 3 or 4 pages that correspond to 3 or 4 separate galleries. I hope this example will explain why I was trying to create 3 or 4 different pages that would sit behind a “section” page called photos (that links to each gallery).
In view of this I had been initially looking at creating pages that were sub sections of the ‘photos’ section and each is a different page and lets me define precisely the layout while pulling in sidebar and footer from textpattern…

I think that I just need to carry on like that and start looking at the forwarding plug-in to figure out how to get it to work properly rather than bothering you with this.

Thanks,

John

PS : I finally got it to work using the plug-in (I had regular expressions turned on when it should have been off !) Thanks for all your help and sorry to be so long at figuring out my mistakes :(

Last edited by jag (2006-07-03 23:40:25)

Offline

#18 2006-07-04 14:12:45

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

Re: static page in section or subsection

jag wrote:

Well I’m not getting it here at all. If I create an article and say that I want it in the section ‘photos’ and I then assign a category ‘photos_professional’ I don’t see how from there I can define the page layout that is different to the photos page and has specific JavaScript code that is also different to the photos page…

If you still want to give this a try (you don’t have to of course), put something like this on your ‘photos’ page template:
<code>
<txp:if_category name=“photos_professional”>
<txp:article />
and all other content you also want to go on the photos_professional page, including the script
<txp:else />
here the content for your regular photos page
</txp:if_category>
</code>

Last edited by els (2006-07-04 14:13:25)

Offline

Board footer

Powered by FluxBB