coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: allvip on March 03, 2014, 07:49:04 AM

Title: Move picture title and description
Post by: allvip on March 03, 2014, 07:49:04 AM
How can I move rating starts and navmeu between picture title and picture on displayimage.php like this:

picture title
picture description
navmenu
rating stars
image
Title: Re: Move picture title and description
Post by: Αndré on March 04, 2014, 09:46:23 AM
Copy the function theme_display_image from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist.

Find
echo $votes;
and move it above
    starttable();
    echo $picture;
    endtable();


find
    starttable();
    echo $nav_menu;
    endtable();

and above, add
    starttable();
    echo template_extract_block($picture, 'title');
    echo template_extract_block($picture, 'caption');
    endtable();
Title: Re: Re: Move picture title and description
Post by: allvip on March 05, 2014, 09:52:59 PM
Quote from: Αndré on March 04, 2014, 09:46:23 AM

    starttable();
    echo template_extract_block($picture, 'title');
    echo template_extract_block($picture, 'caption');
    endtable();


That's what I need it and did not know how to do.

Thanks it worked.
Title: Re: Move picture title and description
Post by: allvip on March 22, 2014, 08:44:11 AM
Very often:

Template error
Failed to find block 'caption' (#<!-- BEGIN caption -->(.*?)<!-- END caption -->#s) in :

             
and no image.

If I remove the code the page shows the right way.
Title: Re: Move picture title and description
Post by: Αndré on March 27, 2014, 01:30:37 PM
Please try what happens if you comment out the following code block in theme_html_picture:
Code (include/themes.inc.php or themes/yourtheme/theme.php) Select
    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }
Title: Re: Move picture title and description
Post by: allvip on March 27, 2014, 02:05:49 PM
It worked.Thanks.
Title: Re: Move picture title and description
Post by: Αndré on March 27, 2014, 02:17:09 PM
Instead of modifying two functions, I suggest to undo the mod in theme_html_picture. Instead replace the mod
    starttable();
    echo template_extract_block($picture, 'title');
    echo template_extract_block($picture, 'caption');
    endtable();

with
    global $CURRENT_PIC_DATA;
    starttable();
    if ($CURRENT_PIC_DATA['title']) {
        echo template_extract_block($picture, 'title');
    }
    if ($CURRENT_PIC_DATA['caption']) {
        echo template_extract_block($picture, 'caption');
    }
    endtable();

in theme_display_image.
Title: Re: Re: Move picture title and description
Post by: allvip on March 27, 2014, 02:22:33 PM
Quote from: Αndré on March 27, 2014, 02:17:09 PM
Instead of modifying two functions

Thanks a lot.I disliked the ideea to add another function.Plus theme_html_picture is a big function.

It worked.