Line Breaks in Navigation Items
Permalink
I am working on a site - whose Design specs demand that the tile items in the main Navigation be broken into 2 lines (I have suggested, without success that we change this requirement.) I have managed to do it by inserting line breaks in the navigation - however now the tags are appearing in the page title (on the browser) you can see the site here:http://www.extremeicesurvey.org/index.php... it is still in the early development phase, but promises to be a cool site. Any ideas on how to solve this issue?
Remo,
Could you give me an example of what the CSS code for a floated UL fixed bock width code would look like? I haven't been able to fix the width around a single entry, without just pushing the entire nav out onto a second line.
Could you give me an example of what the CSS code for a floated UL fixed bock width code would look like? I haven't been able to fix the width around a single entry, without just pushing the entire nav out onto a second line.
the meta title attribute should actually do just this. you may have to make sure your theme uses it if it's available, but that's what we use
What I've seen in other CMS is that some fancy/unusual character like e.g. a pipe-symbol gets added to the title like so:
Some blurb | this goes into the next line
Then, when this string gets outputted the pipe gets replaced with a <br>-tag like so:
so in the HMTL you get this:
So far I've done this locally for all my blog entries.
Maybe there is a place somewhere globally where you could define that whole str_replace stuff so whenever there is a | inside the title (or maybe even any text!) it gets replaced with <br />.
Some blurb | this goes into the next line
Then, when this string gets outputted the pipe gets replaced with a <br>-tag like so:
<?php echo str_replace('|','<br />', $title); ?>
so in the HMTL you get this:
Some blurb<br />this goes into the next line
So far I've done this locally for all my blog entries.
Maybe there is a place somewhere globally where you could define that whole str_replace stuff so whenever there is a | inside the title (or maybe even any text!) it gets replaced with <br />.
this is exactly what I need.
where have I add this lines of code?
where have I add this lines of code?
I found the global way!
in line 119 of the autonav view.php:
change:
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '</a>';
to:
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . str_replace('|','<br />', $ni->name) . '</a>';
in line 119 of the autonav view.php:
change:
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '</a>';
to:
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . str_replace('|','<br />', $ni->name) . '</a>';
… an in concrete/elements/header_required.php
There is one more modification to remove the Pipe | from the page title.
change
$pageTitle = $akt;
?><title><?php echo htmlspecialchars($akt, ENT_COMPAT, APP_CHARSET)?></title>
<?php } else {
$pageTitle = htmlspecialchars($pageTitle, ENT_COMPAT, APP_CHARSET);
?><title><?php echo sprintf(PAGE_TITLE_FORMAT, SITE, $pageTitle)?></title>
to:
if ($akt) {
$pageTitle = $akt;
?><title><?php echo htmlspecialchars($akt, ENT_COMPAT, APP_CHARSET)?></title>
<?php } else {
$pageTitle = str_replace(' | ',' ', htmlspecialchars($pageTitle, ENT_COMPAT, APP_CHARSET));
?><title><?php echo sprintf(PAGE_TITLE_FORMAT, SITE, $pageTitle)?></title>
There is one more modification to remove the Pipe | from the page title.
change
$pageTitle = $akt;
?><title><?php echo htmlspecialchars($akt, ENT_COMPAT, APP_CHARSET)?></title>
<?php } else {
$pageTitle = htmlspecialchars($pageTitle, ENT_COMPAT, APP_CHARSET);
?><title><?php echo sprintf(PAGE_TITLE_FORMAT, SITE, $pageTitle)?></title>
to:
if ($akt) {
$pageTitle = $akt;
?><title><?php echo htmlspecialchars($akt, ENT_COMPAT, APP_CHARSET)?></title>
<?php } else {
$pageTitle = str_replace(' | ',' ', htmlspecialchars($pageTitle, ENT_COMPAT, APP_CHARSET));
?><title><?php echo sprintf(PAGE_TITLE_FORMAT, SITE, $pageTitle)?></title>
you could create another page attribute "subtitle" and create you own autonav template...
or use css and let css make the line breaks.. fixed width block element and there you go..
site looks cool so far!