Go!
 
 
July 24, 2008, 07:10:15 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Please help with Page Title modification  (Read 6781 times)
zANavAShi
Newbie
*
Offline Offline

Posts: 34


View Profile
« on: October 01, 2006, 09:42:42 AM »

I cannot wait for the release of Easy Gallery 1.0 beta 3 and need to manually edit some code in this component before I upload it to my live web server.

Please can somebody help me modify the following code in file easygallery.html.php

Current lines 101-104:
Code:
    $mainframe->setPageTitle(sprintf(EG_VIEW_PHOTO, $row->name));
    $mainframe->addCustomHeadTag('<link href="'. $mainframe->getCfg('live_site') . '/components/com_easygallery/style.css" rel="stylesheet" type="text/css" />');
   
    echo '<div class="componentheading">' . sprintf(EG_VIEW_PHOTO, $row->name) . '</div>';

So that I get the following results:

1. When I click on "My Photo Gallery" from the mainmenu the setPageTitle will also be "My Photo Gallery" (as derived from the mainmenu settings)

2. When I click on into a category from the first page the new setPageTitle will be only "{CAT_NAME}" - instead of "View category {CAT_NAME}"

3. When I click into a photo from the category page the new setPageTitle will be only "{IMAGE_NAME}" - instead of "View picture {IMAGE_NAME}"

Thanks for reading in and thanks in advance for your replies.

Cheers,
Zana
Logged
Adam
Administrator
Hero Member
*****
Offline Offline

Posts: 4.580



View Profile WWW
« Reply #1 on: October 01, 2006, 03:30:12 PM »

Change this line:

Code:
  $mainframe->setPageTitle(sprintf(EG_SHOWCATEGORY, $row->name));

to:
Code:
    if(!$row->name){
      $mainframe->setPageTitle(EG_SHOWCATEGORIES);
    } else {
      $mainframe->setPageTitle(sprintf(EG_SHOWCATEGORY, $row->name));
    }

and add this to your language file:
Code:
define('EG_SHOWCATEGORIES', 'View image galleries');
Logged

- Joomla developer -

IMPORTANT: http://www.joomla-addons.org/option,com_smf/Itemid,7/topic,1332.0.html
Do not send support requests by PM. Post on the forum instead.
simonr
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #2 on: October 01, 2006, 04:46:05 PM »

I had similar requirement to yours Zana and Adams solution above fixes the browser page title but not the titles shown on the page.

I made the following tweaks which i think answer you questions...

to show category and image titles without the "view category" and "view image" prefix modify their values in your language file so they are like this:
Code:
define('EG_SHOWCATEGORY', '%s');
define('EG_VIEW_PHOTO', '%s');

But this will leave your front page without a title so in your easygallery.html.php you can modify Adams suggestion above to fix this by making it:
Code:
if (!$row->name){
$pagetitle = EG_SHOWCATEGORIES;
$mainframe->setPageTitle(EG_SHOWCATEGORIES);
} else {
$pagetitle = sprintf(EG_SHOWCATEGORY, $row->name);
$mainframe->setPageTitle(sprintf(EG_SHOWCATEGORY, $row->name));
}

and then updating this line
Code:
<div class="componentheading"><?php echo sprintf(EG_SHOWCATEGORY$row->name); ?></div>
to read...
Code:
<div class="componentheading"><?php echo $pagetitle?></div>

Hope that helps - it worked for me!
Simon
Logged
zANavAShi
Newbie
*
Offline Offline

Posts: 34


View Profile
« Reply #3 on: October 01, 2006, 05:27:03 PM »

LOL simonr, removing those from the language file was the very first thing I tried, but it drove me nuts that the front page didn't have a title!

Adam's solution didn't work at all for me, but your one worked PERFECTLY. Yayyyy, my gallery looks exactly how I want now!

Thanks so much for the responses guys.

Cheers,
Zana

PS: Maybe Adam will feel inspired to integrate some of these hacks in v1.0 beta 3 eh?  Wink
Logged
garvaldmains
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #4 on: November 02, 2006, 01:54:39 PM »

Hi all,

 A newbie question.  At the moment for every category of photos that i upload i have the category name then view category for each one.  What I would like it to be is that for say one particular team you click on the category name itself instead of 'view category'.  As the site is for *many* football teams the category listing is big and scrolls down and down ...
Have a look at http://www.bucksccfconline.co.uk/index.php?option=com_easygallery&Itemid=21.  I tried following some of the coding changes you guys suggested but am not sure they were going to achieve what i wanted.

I know there is probably an easy answer.... Undecided

Di

p.s. fab fab add on!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Joomla-addons.org © 2006 | www.bandhosting.nl | JCD-A Member | Newsletter | Sitemap |