nukeSEO.com - PHPNuke SEO Search engine optimization, professional tools including nukeSEO, nukeSPAM, nukeFEED, nukePIE, nukeWYSIWYG and more

 

. Welcome to nukeSEO.com  ! 
.
.
.


.
nukeSEO.com: Forums


 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Moving forward from Dynamic Titles
 
 
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeNAV (tm)
View previous topic :: View next topic  
Author Message
spasticdonkey
webmaster


Joined: Oct 26, 2007
Posts: 69

PostPosted: Sat Oct 03, 2009 2:17 am    Post subject: Moving forward from Dynamic Titles Reply with quote

Loving the new dh setup, but scratching my head a little on how to get custom titles on some html-only modules... I was able to "hack" dynamic titles using the $file variable, like so:
Code:
// WW2_Archives

elseif ($name == 'WW2_Archives') {
   global $file;
   if($file == 'index') {
   $newpagetitle = 'World War II Archives - WW2 Photos - WW2 Pictures - Wartime Photography - '.$sitename;
   }
   if($file == 'gallery1') {
   $newpagetitle = 'WW2 Photo Gallery I - World War II - Black and White Photographs from The US National Archives - '.$sitename;
   }
   if($file == 'gallery2') {
   $newpagetitle = 'WW2 Photo Gallery II - World War II - Combat Photography from The US National Archives - '.$sitename;
   }
etc............
}

but i obviously can't do that for dh, so I assume I'll have to create some sql tables to hold some basic data for these pages.. But since the pages aren't loaded from the db, I'm not sure how nukeDH associates the page being viewed with the db tables I would create...?

or maybe some way to override/define from within the $file?

any advice?
  
Back to top
View user's profile Send private message Visit poster's website
kguske
Site Admin
Site Admin


Joined: May 12, 2005
Posts: 876

PostPosted: Tue Oct 06, 2009 10:40 pm    Post subject: Reply with quote

You can create a nukeSEO DH content class for your modules, but the design assumes / requires that each individual content page has a unique ID. If you're using a character variable file to identify each page, you'll need to override the getContentID and setContentID functions (this is done for every DH class anyway).

This will allow you to override the title, META description and META keywords for unique pages in this module.

Code:
function getContentID() {

  global $file;
  $cid = 0;
  if ($file == 'index') $cid= 0;
  elseif ($file == 'gallery1') $cid = 1;
  elseif ($file == 'gallery2') $cid = 2;
  return $cid;
}

function setContentID() {
  global $file, $dhID;
  if ($dhID == 0) $file == 'index';
  elseif ($dhID == 1) $file == 'gallery1';
  elseif ($dhID == 2) $file == 'gallery2';
}

_________________
  
Back to top
View user's profile Send private message Visit poster's website
spasticdonkey






PostPosted: Wed Oct 07, 2009 12:20 am    Post subject: Reply with quote

awesome, thanks a bunch!
  
Back to top
Display posts from previous:       
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeNAV (tm) All times are GMT - 5 Hours
 
 Page 1 of 1

 

Jump to:   
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

Powered by phpBB © 2001-2008 phpBB Group


Page Generation: 0.06 Seconds