custom <header> lines
Permalink
I have a custom header.php with the following code:
Now I want for example $pobj->cID to appear in a <meta type="whatever" content="$pobj->cID"> header-line. How could I do this? Is there any c5 function that I just need to call and tell him what to aditionally put into the header?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head> <link href="<?php echo $this->getThemePath();?>/main.css" rel="stylesheet" type="text/css"> <?php Loader::element('header_required'); ?> </head> <body> <?php include_once(dirname(__FILE__) . "/../Constants/ThemeConstants.php"); ?>[/core] But now I have a custom site "publications.php" which lists lots of publications. I can also add, edit and view those publications over concrete5. Now the problem: I want for each of those publications specific data to appear in the header, in the meta information. I know that there is a custom attribute for meta title and stuff, but I need some things to be set up automatically... This is the starting of my publications.php: [code]<?php defined('C5_EXECUTE') or die(_("Access Denied."));
Viewing 15 lines of 21 lines. View entire code block.
Now I want for example $pobj->cID to appear in a <meta type="whatever" content="$pobj->cID"> header-line. How could I do this? Is there any c5 function that I just need to call and tell him what to aditionally put into the header?
I think the easiest way would be to add a new custom attribute to the page type you are using. Then add the custom information for all the pages which use that page type and fill in the value. You could also add the custom attribute as default for that page type so that you don't have add it to new pages each time you create a new page.
Then call the attribute value by its handle.
So something like this:
Then call the attribute value by its handle.
So something like this:
<meta name="custom_meta" content="<?php $c->getAttribute('custom_meta'); ?>" />
But I need data from other blocks in the meta-Tag, and I don't really wanna have the same data twice for each publication, once in the block and once for a meta attribute.
Can I also add block data to a custom meta tag?
Can I also add block data to a custom meta tag?
You could add the block to your global scrapbook and then display it in your template like this:
<?php $block = Block::getByName('Meta title'); $block->display(); ?>
You might be interested in this:
http://www.concrete5.org/marketplace/addons/magic-heading/...
http://www.concrete5.org/marketplace/addons/magic-heading/...
I try again:
I have a custom header.php with the following code:
But now I have a custom site "publications.php" which lists lots of publications. I can also add, edit and view those publications over concrete5. Now the problem: I want for each of those publications specific data to appear in the header, in the meta information. I know that there is a custom attribute for meta title and stuff, but I need some things to be set up automatically...
This is the starting of my publications.php:
Now I want for example $pobj->cID to appear in a <meta type="whatever" content="$pobj->cID"> header-line. How could I do this? Is there any c5 function that I just need to call and tell him what to aditionally put into the header?