x
Toggle Content    Register or Login  -  October 19, 2018, 2:39 am  
Toggle Content Commercial Themes
This is an opportunity for you to preview TCD commercial themes. All themes seen here can be purchased from the store.
Toggle Content User Info

Welcome Anonymous

Toggle Content Navigation
Toggle Content Project Status
Support Forums » DragonflyCMS » Tips & Tricks » Active Page Trick!
Please use the forum search before making a post. Your question might have been previously answered.

Active Page Trick!
Some of the best non-standard tricks for your site all in one location.


Post new topic   Reply to topic    Forum Index » Tips & Tricks Printer Friendly Page

View previous topic :: View next topic  
Author Message
Lead Developer


PostPosted: Mon Jun 25, 2007 9:42 am Reply with quote

In theme.php assign the variable which will set off code to be displayed when only this module is displayed.

Code:
'IS_GALLERY' => $module_name == 'coppermine',

In header.html or any template file use this code:
Code:
<!-- IF IS_GALLERY -->
This will show up only when viewing the gallery module.
<!-- ENDIF -->


_________________

Back to top
View user's profile Photo Gallery
Member


PostPosted: Mon Jun 25, 2007 2:19 pm Reply with quote

You got to be kidding me!

I split my css menu into it's own PHP menu and wrote in a switch to get the active page links to work using get_uri.

If this is all I had to do then fantastic! I will try it out


Back to top
View user's profile
Lead Developer


PostPosted: Mon Jun 25, 2007 2:35 pm Reply with quote

I believe this comes from t13os.
He posted this in the DF forums a very long time ago
. I ignored it at the time and figured I'd get back around to it. Thank god that post was never deleted. I've checked it out and it works perfectly. Smile


_________________

Back to top
View user's profile Photo Gallery
Lead Developer


PostPosted: Thu Jun 28, 2007 3:30 pm Reply with quote

OK I've gone in and done up a little demo on the current version of DF_SovereignBlue running on this site. I've tried hard as I could to get it to work with active pages but couldn't do it. Best I could do was get it working for modules. So you can't do it page by page only per module. Still though it's better than nothing.

Code:
					<!-- IF U_MAININDEX -->
					<!-- IF IS_NEWS -->
					<td><a href="{U_MAININDEX}"><img src="{THEME_PATH}/images/nav_is_home.gif" border="0" alt="{S_HOME}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_MAININDEX}"><img src="{THEME_PATH}/images/nav_home.gif" border="0" alt="{S_HOME}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->

					<!-- IF S_FORUMS -->
					<!-- IF IS_FORUMS -->
					<td><a href="{U_FORUMS}"><img src="{THEME_PATH}/images/nav_is_forums.gif" border="0" alt="{S_FORUMS}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_FORUMS}"><img src="{THEME_PATH}/images/nav_forums.gif" border="0" alt="{S_FORUMS}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->

					<!-- IF S_GALLERY -->
					<!-- IF IS_GALLERY -->
					<td><a href="{U_GALLERY}"><img src="{THEME_PATH}/images/nav_is_gallery.gif" border="0" alt="{S_GALLERY}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_GALLERY}"><img src="{THEME_PATH}/images/nav_gallery.gif" border="0" alt="{S_GALLERY}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->

					<!-- IF S_G2GALLERY -->
					<!-- IF IS_G2GALLERY -->
					<td><a href="{U_G2GALLERY}"><img src="{THEME_PATH}/images/nav_is_gallery.gif" border="0" alt="{S_G2GALLERY}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_G2GALLERY}"><img src="{THEME_PATH}/images/nav_gallery.gif" border="0" alt="{S_G2GALLERY}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->

					<!-- IF S_DOWNLOADS -->
					<!-- IF IS_DOWNLOADS -->
					<td><a href="{U_DOWNLOADS}"><img src="{THEME_PATH}/images/nav_is_files.gif" border="0" alt="{S_DOWNLOADS}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_DOWNLOADS}"><img src="{THEME_PATH}/images/nav_files.gif" border="0" alt="{S_DOWNLOADS}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->

					<!-- IF S_IS_USER -->
					<!-- IF IS_YOUR_ACCOUNT -->
					<td><a href="{U_MY_ACCOUNT}"><img src="{THEME_PATH}/images/nav_is_myaccount.gif" border="0" alt="{S_MY_ACCOUNT}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_MY_ACCOUNT}"><img src="{THEME_PATH}/images/nav_myaccount.gif" border="0" alt="{S_MY_ACCOUNT}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->

					<!-- IF S_IS_USER -->
					<!-- ELSE -->
					<!-- IF IS_YOUR_ACCOUNT -->
					<td><a href="{U_MY_ACCOUNT}"><img src="{THEME_PATH}/images/nav_is_register.gif" border="0" alt="{S_MY_ACCOUNT}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_MY_ACCOUNT}"><img src="{THEME_PATH}/images/nav_register.gif" border="0" alt="{S_MY_ACCOUNT}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->


					<!-- IF S_IS_ADMIN -->
					<!-- IF U_ADMININDEX -->
					<td><a href="{U_ADMININDEX}"><img src="{THEME_PATH}/images/nav_is_admin.gif" border="0" alt="{S_ADMIN}" /></a></td>
					<!-- ELSE -->
					<td><a href="{U_ADMININDEX}"><img src="{THEME_PATH}/images/nav_admin.gif" border="0" alt="{S_ADMIN}" /></a></td>
					<!-- ENDIF -->
					<!-- ENDIF -->

Notice that the Home module must be hardcoded in so that will need to be changed by the admin for their own site. If this method becomes popular then it's going to become a FAQ among users. Just FYI to the designers that use it.

The admin hover is always on. Couldn't figure out how to shut it off even though the code is done exactly like the others it wouldn't work.

The Your_Account or Register image switch if a user or guest works perfectly in the above code. Took me about 2 hours of sitting down to find the right combination of if's and else's till I got that one right.

All the rest of the modules work great.


_________________

Back to top
View user's profile Photo Gallery
  Page 1 of 1All times are GMT - 5 Hours

Post new topic   Reply to topic    Forum Index » Tips & Tricks Printer Friendly Page

  
  
  
 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


RSS-News
RSS-Downloads
RSS-Forums
RSS-KnowledgeBase
Valid CSS!
Valid HTML 4.01!

Site Search | Support | Contact | Payments | Link to Us
All TCD logos and trademarks in this site are property of TreasureCoastDesigns.com
Interactive software released under GNU GPL, Code Credits, Privacy Policy
TCD_Natural © T.C.D.