photo

Ed Wieczkiewicz

shared this question
7 years ago

Employees Involved

photo

PIV Support

Admin

Statistics

5
Comments
511
Views

Share

1
votes

listing header changer

I would like to be able to change the header based on class for listing pages. I've 8 classes and would like to have a separate header for each so whenever a listing in a certain class is displayed it would have the appropriate header. I've researched the OR forum archives and found several approaches and wondered what is the best way to go about this?

Can I create a series of separate main.html templates based on class? ie. main_pclass1.html

Add Comment

Comments (5)

photo
1

thank you

photo
1

The docs under listing detail templates explain how to customize the listing content appearance, what I'd like to do is change the header picture and that necessitates working with the main.html template. I found a scrap of code in the archives that swaps the header based on state and I tried it and it works I put the following code in place of <div id="header"> in the main.html file.

<?php//start by checking if we're viewing a property by stateif(isset($_GET['state'])){//we are! lets get the matching imageecho '<div id="'.$_GET[state].'">';} else//No property state, lets just view the main logo for the site{//show the default imageecho '<div id="header">';}?>

Is it possible to modify this bit of PHP instead of state to use class? I'm not a PHP coder.

photo
1

Or is this feasible: could I put the customized <div id ="header"> statement on each of the listing_detail_pclass#.html pages I create and eliminate it from the main.html template altogether?

photo
1

After a little experimenting my final solution was to utilize the listing_detail_pclass#.html files and move the <div id ="header"> and <div id=menu> statements from the main.html file to be included in that file. By removing them from the main.html file it gives me the freedom to do a custom header and custom menu for any page.

Leave Comment

photo

Attach files...

The file must be a jpg, gif, png, bmp, ico, pdf, doc, rtf, txt, zip or rar no more than 20M