Edit Title

cenkgoksel Member
edited January 2022 in General support

Hi everyone just want to ask is there any way to edit title of the photos or album pages.
for example ;
in this page:
https://www.fdream.co.uk/index.php?album=Cream&image=fluffy-103.jpg

title: Handmade Cream Blanket | Cream blankets | Fluffy Dreams

in this page title can i edit like how i want be couse i want to take of ( cream blankets ) from middle be couse its to long and not make sanse.

Thanks very much

Comments

  • fretzl Administrator, Developer
    edited January 2022

    I see you're using the zp-base theme. Try this: in the theme folder find inc/header.php. Now look for printHeadTitle(); (line 101)
    and change this to printHeadTitle(' | ', false, false);.
    Further reading:
    https://www.zenphoto.org/news/theming-tutorial/
    and
    https://docs.zenphoto.org/1.5.x/function-printHeadTitle.html

  • Thanks for answer
    Do we have a chance to add separate titles to the album and photo pages one by one?

  • acrylian Administrator, Developer

    Do we have a chance to add separate titles to the album and photo pages one by one?

    Not without editing/modifying the theme. THere are separate functions available. Please review the links fretzl posted for the basics of themining

  • Dear @acrylian and @fretzl thanks very much for response me again.
    I have been reading many times try understand to many times but I do not understand how to modifiying the theme. Im not a programmer but i do my website i can open and change the codes in php thats not a problem but still not understand how is it going to be.
    i have change printHeadTitle(); (line 101)
    and change this to printHeadTitle(' | ', false, false)
    on header.php
    but noting happened. what i have to do more can you please explain to me with little bid more details thanks very much sory for take your times.

  • acrylian Administrator, Developer

    That actually would work. Are you sure you edited the right file and actually the one on your site?

    Also looking at the source code quickly you should check your modifications as I see invalid code (which is not form the zbase theme itself):

     <!DOCTYPE html>
     <html lang="en-GB">
       <head>
       <meta name="viewport" content="width=device-width, initial-scale=0.7 maximum-scale=1.0"/>
       <style> img { max-width: 100%; height: auto; } </style>
        <center><a href="https://www.fdream.co.uk">
        <img border="0" src="https://www.fdream.co.uk/logo.jpg" alt="FLUFFY DREAMS"></a></center>
       (…)
    

    Beside <center> is a html element that is deprecated it is invalid within the header as is the <img>' and` element.

  • fretzl Administrator, Developer

    About the title:
    You are correct. It doesn't work like it should. Sorry for that.
    We are looking into it.

    In the meantime try this:

    In inc/header.php (line 101) replace

    <?php printHeadTitle(); ?>

    with

    <title>
    <?php
        switch ($_zp_gallery_page) {
            case 'album.php':
                echo getBareAlbumTitle(); echo ' | ';
                break;
            case 'image.php':
                echo getBareImageTitle() . ' | '; 
                break;
        }
        echo getMainSiteName();
    ?>
    </title>
    
  • cenkgoksel Member
    edited January 2022

    Dear @acrylian and @fretzl thanks very much for your help again.

    Dear @fretzl i edit the printheadtitle code like how u say;


    if ((class_exists('RSS')) && ($rss_option != null)) printRSSHeaderLink($rss_option,$rss_title); ?>


    <?php switch ($_zp_gallery_page) { case 'album.php': echo getBareAlbumTitle(); echo ' | '; break; case 'image.php': echo getBareImageTitle() . ' | '; break; } echo getMainSiteName(); ?>

    <meta name="description" content="<?php echo $zpbase_metadesc; ?>" />   
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?php echo $_zp_themeroot; ?>/css/style.css">
    

    for example in this photo page old title was:
    title: Handmade Cream Blanket | Cream blankets | Fluffy Dreams

    new title; Handmade Cream Blanket |

    its actualy work but its deleted main title aswell Fluffy Dreams,
    plus after couple of times open chrome give error message ( http 500 error ) but in phone and internet explorer still was opening thats why i have to change it back maybe i put the code somehere wrong ?

    is there any way we can only put it there like;

    title: Handmade Cream Blanket | Fluffy Dreams

    from photo pages takes out middle title and keep only main one plus this page name like this.

    Like only; ( ImageTitle | MainSiteName )
    for image pages.

    Thanks for your time

  • fretzl Administrator, Developer

    I guess the Gallery title() is needed here instead of the getMainSiteName().

    Try this instead:

    <title>
    <?php
        switch ($_zp_gallery_page) {
            case 'album.php':
                echo getBareAlbumTitle(); echo ' | ';
                break;
            case 'image.php':
                echo getBareImageTitle() . ' | '; 
                break;
        }
        echo getBareGalleryTitle();
    ?>
    </title>
    

    from photo pages takes out middle title and keep only main one plus this page name like this.

    That is what this code does.

  • acrylian Administrator, Developer
    edited January 2022

    To explained the difference:

    • gallery title: The title of your Zenphoto site. Gallery is a general term used whole site "gallery".
    • main site title: The title of an optional parent site in case you use Zenphoto as a part of/within another site.
  • Thanks Very much for all information last code work perfect.

Sign In or Register to comment.