CSS ID and global scrapbook
Permalink
Hello All,
I have a logo in my website. What I did is have an image block in my global scrapbook called My_Site_Logo. I design it and under the tab CSS I give the field ID the value main-logo as I want my image to have that ID in the generated code.
In my html I have
<?php
$block = Block::getByName('My_Site_Logo');
if( $block && $block->bID ) $block->display();
else echo SITE;
?>
Everything works well except that C5 puts a div around the img tag and gives the div the main-logo id. Also I'm not too comfortable with having an important css ID accessible from the scrapbook.
So there are 2 things I would like to do:
1) make sure the Id="main-logo" is given to the img tag and avoid an unnecessary DIV tag.
2)if possible, hardcode the Id="main-logo" in the html so that the image is accessible and editable from the scrapbook but not the value of the ID.
Manythanks for your help
I have a logo in my website. What I did is have an image block in my global scrapbook called My_Site_Logo. I design it and under the tab CSS I give the field ID the value main-logo as I want my image to have that ID in the generated code.
In my html I have
<?php
$block = Block::getByName('My_Site_Logo');
if( $block && $block->bID ) $block->display();
else echo SITE;
?>
Everything works well except that C5 puts a div around the img tag and gives the div the main-logo id. Also I'm not too comfortable with having an important css ID accessible from the scrapbook.
So there are 2 things I would like to do:
1) make sure the Id="main-logo" is given to the img tag and avoid an unnecessary DIV tag.
2)if possible, hardcode the Id="main-logo" in the html so that the image is accessible and editable from the scrapbook but not the value of the ID.
Manythanks for your help