• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

Custom header/pages & Translations

buzzdee

Chevereto Member
Hi Rodolfo,

I've got two questions...

1. How does the translation in "pages" work?
For example, when I insert the german word "Datenschutz" in here, it is correctly translated to "Privacy". This also works with "Nutzungsbedingungen" --> "Terms of Service".
PHP:
<?php
// Some G\ magic, set the page doctitle from theme file
G\Handler::$vars['doctitle'] = 'Datenschutz - ' . G\Handler::$vars['doctitle'];
?>
Other words are not translated. So I guess these words are part of the "core"-translation?
Is there a way to get custom page-titles translated?

2. I don't get the custom hooks to work, according to add some META tags. This solution does not work (white screen on homepage, but pictures are shown... weird)
http://chevereto.com/community/threads/meta-description.4419/#post-25669
Could you please explain how to add some (facebook)-tags like og:title, og:description, og:image-url....
And of course to add some META-tag like "description" and so on...

Thanks a lot for your amazing work!
 
1. You need to add those extra words. Best thing is to create a custom page for each lang. You can create a folder inside the pages folder like "terms" and inside that put de.php, en.php etc. Then load the one that you need to use in the main page.

2. First you should try to do it just by html. Now, HTML in PHP is like this:
PHP:
<?php
/* I'm PHP CODE */
?>
<p>I'm HTML CODE!</p>
<?php echo "<p>I'm also HTML CODE</p>"; ?>
<p>And I'm HTML with <?php echo 'PHP'; ?> CODE</p>

So most likely is just a syntax error.
 
Hi Rodolfo,

Thanks for your help, but there's still some question ;-)

1.
Then load the one that you need to use in the main page.
How do I do this?

2. It works, but how can I overwrite some Tags?
For example: If I set a new <title> in the custom header.php, two <title> tags are parsed ...
Code:
<?php
if(!defined('access') or !access) die('This file cannot be directly accessed.');
/* Add here your custom header code */

?>
<title>New Page Title </title>

3. Where can I find all the "get_image" and other parameters? Are there any docs, or at least could you tell me in which file i could search them ?
For example, the get_image() outputs an arry, but I need the image-url...
Code:
<meta property="og:title" content="<?php echo get_doctitle(); ?>" />
<meta property="og:url" content="<?php echo get_image(); ?>" />
<meta property="og:image" content="<?php echo get_image(); ?>" />
 
Last edited:
1. Something like include("de.php"); where "de" can be known using CHV\get_lang_used()['short_name']
2. <title> is something that you must control from the route or at least in header.php. The other alternative is use chevereto-hook.php file which is in the app folder.
3. get_image or get_album or anything is actually a shorthand for G\Handler::$vars. You can just var_dump(G\Handler::$vars) and see all the vars handler by the handler.
 
Sorry, I have the same problem))
I have done differently, I thought that is logical, but does not work.

#: ../../../app/themes/Peafowl/header.php:309
#: ../../../app/themes/Peafowl/pages/tos.php:4
msgid "About Us"
msgstr "balblabla"

I just do not understand where and how to write this code CHV\get_lang_used()['short_name']
 
Back
Top