Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Add header to detailed pages in certain category?

Quote Reply
Add header to detailed pages in certain category?
Is it possible to have some HTML show on detailed pages in individual categories?

For example:

Main : No info here
Main > Cat1 > Detailed : No info here
Main > Cat2 > Detailed : Info Message Here
Main > Cat 2 > SubCat1 > Detailed : Info Message Here

I hope this makes sense.

Last edited by:

MJB: Oct 22, 2009, 11:43 AM
Quote Reply
Re: [MJB] Add header to detailed pages in certain category? In reply to
MJB wrote:
Is it possible to have some HTML show on detailed pages in individual categories?

For example:

Main : No info here
Main > Cat1 > Detailed : No info here
Main > Cat2 > Detailed : Info Message Here
Main > Cat 2 > SubCat1 > Detailed : Info Message Here

I hope this makes sense.

Not 100% sure what you are planning to do, however you can display info of your choice on detailed page using below option:

1. Edit detailed.html page and insert content in there as you wish.

2. Now if you are using luna template, then you can setup condition like if page_id eq detailed in the include header.html page so that the info will be shown only on detailed page.

3. Now if you want to show 'different' information, or link specific information, than just create a new link property, and add that property page in include header.html with condition, so that it will display only on detailed page.

4. If you wish to display information specific to category (that is same info for all detailed page in given category, and then different set of info for second category), than you will have to use Andy's plugin, so that you can display category path on detailed page, and then use condition like if category name starts with type condition in header and it should work.

Hope this is what you were looking for.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Add header to detailed pages in certain category? In reply to
Your number 4 sounds like what I'm after.

Example:

I have a category 'Red' with detailed pages and a category 'Black'. I want all the Detailed pages in Black to have a line of text on them - "All details on this page relate to black". Obviously I don't want this text to display on the detailed pages in the Red category. The same applies to subcategories.
Quote Reply
Re: [MJB] Add header to detailed pages in certain category? In reply to
MJB wrote:
Your number 4 sounds like what I'm after.

Example:

I have a category 'Red' with detailed pages and a category 'Black'. I want all the Detailed pages in Black to have a line of text on them - "All details on this page relate to black". Obviously I don't want this text to display on the detailed pages in the Red category. The same applies to subcategories.


If there are not too many categories than you can simply try

1. create one txt or html file with conditions like
if category id eq
insert this
elsif category id eq
insert this...

This will enable you to have unique header section for each category too (if you wish).. however this does seem to be a little lengthy method.

2. Here is another option that you can try..
http://www.gossamer-threads.com/forum/Products_C9/Gossamer_Links_C5/Development%2C_Plugins_and_Globals_F20/Re%3A_%5Bhegu%5D_Same_content_for_specified_category_and_all_subcategories_P305872/#p305872

Also just few posts below, Andy has a global that will enable you to use istart even on detailed page.


Hope this helps.

Vishal
-------------------------------------------------------
Quote Reply
Re: [MJB] Add header to detailed pages in certain category? In reply to
If just showing on the category pages, just add a new field to your Category table:

Header_Text CHAR(255)

Then, in the category.html template add:

Code:
<%if Header_Text%>
<%Header_Text%>
<%endif%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Add header to detailed pages in certain category? In reply to
Code:
<%if Header_Text%>
<%Header_Text%>
<%endif%>

Hey Andy,

Will this work for subcategories too? I mean if parent category has header text, would it display it also for its sub categories???

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Add header to detailed pages in certain category? In reply to
Nah, a global would be able to do that though. Something like this should work (this example will only work with 3 levels deep)

Code:
sub {
# ID FatherID
# Test 1 0
# Test/Something 2 1
# Test/Something/Another 3 2

# If we are on Test/Something, we need to get the "Description" from the cat below
# If we are on Test/Something/Another, we need to get the "Description" from the cat below

my $FatherID = $_[0];

my $father_id_2 = $DB->table('Category')->select( ['FatherID'], { ID => $FatherID } )->fetchrow;
my $father_id_3 = $DB->table('Category')->select( ['FatherID'], { ID => $father_id_2 } )->fetchrow;

my $desc1 = $DB->table('Category')->select( ['Header_Text'], { ID => $FatherID } )->fetchrow;
my $desc2 = $DB->table('Category')->select( ['Header_Text'], { ID => $father_id_2 } )->fetchrow;
my $desc3 = $DB->table('Category')->select( ['Header_Text'], { ID => $father_id_3 } )->fetchrow;

if ($desc1) {
return $desc1;
} elsif ($desc2) {
return $desc2;
} else { return $desc3; }

}

Code:
<%if Header_Text%>
<%Header_Text%>
<%else%>
<%get_header_text($FatherID)%>
<%endif%>

Untested, but should work.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Add header to detailed pages in certain category? In reply to
Sweet.. seems like a nice add-on.

Thanks again.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Add header to detailed pages in certain category? In reply to
Or, quick and dirty:

Add a new field to Category tables, Print_Head, make it "Yes" or "No", default to "No". Then, if you want, make a global "Header_Cat" and put the header info in there.

Then, just add:

<%if Print_Head = Yes%>
<%Header_Cat%>
<%endif%>

If you ever decide to have multiple different header info, you could just make "Print_Head" = 1, 2, 3, 4, etc. Then have corresponding Header_Cats (Header_Cat1, Header_Cat2, Header_Cat3, etc).
dave

Big Cartoon DataBase
Big Comic Book DataBase