TOC formatting
mishima 145
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: TOC formatting
Philipp
From: Austria
Administrator
1342From: Austria
No, unfortunately you can't use bold tags in a select box. See also http://forums.devshed.com/html-programming-1/bold-formatting-inside-a-select-box-196798.html
1 Re: TOC formatting
mishima
OP
145
From: -
From: -
Great, this works I've tried to add the bold tag in:
But it doesn't seem to want to work. I'd like the page selected from the TOC to be indicated in bold type. Any idea how to achieve this? I have used <b></b> Is this wrong?
<!-- Template: articles_pages_toc_select -->
<option selected="selected" value="{$insert['articlepage_toc_page']}">Page {$insert['articlepage_toc_page']}: {$insert['articlepage_toc_title']}</option>
But it doesn't seem to want to work. I'd like the page selected from the TOC to be indicated in bold type. Any idea how to achieve this? I have used <b></b> Is this wrong?
1 Re: TOC formatting
Philipp
From: Austria
Administrator
1342From: Austria
1) Edit the template articles_pages_toc_select and replace it with this:
2) Replace the PHP part of articles_layout_pages with:
<!-- Template: articles_pages_toc_select -->
<option selected="selected" value="{$insert['articlepage_toc_page']}">Page {$insert['articlepage_toc_page']}: {$insert['articlepage_toc_title']}</option>
2) Replace the PHP part of articles_layout_pages with:
global $database;
$result = $database -> dbquery( "SELECT articlepage_page, articlepage_title FROM " . DB_PREFIX . "esselbach_ct_articlespages WHERE articlepage_article = '" . intval( $insert[ 'article_id' ] ) . "' AND NOT(articlepage_title = '') ORDER BY articlepage_page" );
$second_toc = "";
while( list( $insert[ 'articlepage_toc_page' ], $insert[ 'articlepage_toc_title' ] ) = $database -> dbrow( $result ) )
{
$sel = ($insert['articlepage_page'] == $insert['articlepage_toc_page']) ? " selected=\"selected\"" : "" ;
$second_toc .= "<option value=\"{$insert['articlepage_toc_page']}\"{$sel}>Page {$insert['articlepage_toc_page']}: {$insert['articlepage_toc_title']}</option>";
}
1 Re: TOC formatting
mishima
OP
145
From: -
From: -
Sure - here they are :
<!-- Template: articles_pages_toc -->
<option value="{$insert['articlepage_toc_page']}">Page {$insert['articlepage_toc_page']}: {$insert['articlepage_toc_title']}</option>
<!-- Template: articles_pages_toc_header -->
<script type="text/javascript">
<!--
function jumpnext(page)
{
window.location.href = "{$insert['site_url']}/contentteller{$insert['param_ext']}{$insert['param_ct']}articles{$insert['param_jaction']}pages{$insert['param_jpage']}{$insert['article_seo']},"+document.getElementById("nextpage").value+".html";
}
//-->
</script>
<div style="text-align: right;">
<select id="nextpage" onchange="jumpnext({$insert['articlepage_id']})">
<option value="0">Article Navigation</option>
<!-- Template: articles_pages_toc_select -->
<option selected="selected" value="{$insert['articlepage_toc_page']}">{$insert['articlepage_toc_title']}</option>
<!-- Template: articles_pages_toc_footer -->
</select>
</div>
articles_layout_pages
HTML Part
<div style="text-align: center;"><p style="font-family:verdana;font-size:90%;color:#fecd24"><b>Article Navigation </b><br /> <br />
<select id="nextpage2" onchange="jumpnext2({$insert['articlepage_id']})">
{$second_toc}
</select>
</p>
{$insert['articles_pages_pagenav']}</div>
PHP Part
global $database;
$result = $database -> dbquery( "SELECT articlepage_page, articlepage_title FROM " . DB_PREFIX . "esselbach_ct_articlespages WHERE articlepage_article = '" . intval( $insert[ 'article_id' ] ) . "' AND NOT(articlepage_title = '') ORDER BY articlepage_page" );
$second_toc = "";
while( list( $insert[ 'articlepage_toc_page' ], $insert[ 'articlepage_toc_title' ] ) = $database -> dbrow( $result ) )
{
$sel = ($insert['articlepage_page'] == $insert['articlepage_toc_page']) ? " selected=\"selected\"" : "" ;
$second_toc .= "<option value=\"{$insert['articlepage_toc_page']}\"{$sel}>{$insert['articlepage_toc_title']}</option>";
}
<!-- Template: articles_pages_toc -->
<option value="{$insert['articlepage_toc_page']}">Page {$insert['articlepage_toc_page']}: {$insert['articlepage_toc_title']}</option>
<!-- Template: articles_pages_toc_header -->
<script type="text/javascript">
<!--
function jumpnext(page)
{
window.location.href = "{$insert['site_url']}/contentteller{$insert['param_ext']}{$insert['param_ct']}articles{$insert['param_jaction']}pages{$insert['param_jpage']}{$insert['article_seo']},"+document.getElementById("nextpage").value+".html";
}
//-->
</script>
<div style="text-align: right;">
<select id="nextpage" onchange="jumpnext({$insert['articlepage_id']})">
<option value="0">Article Navigation</option>
<!-- Template: articles_pages_toc_select -->
<option selected="selected" value="{$insert['articlepage_toc_page']}">{$insert['articlepage_toc_title']}</option>
<!-- Template: articles_pages_toc_footer -->
</select>
</div>
articles_layout_pages
HTML Part
<div style="text-align: center;"><p style="font-family:verdana;font-size:90%;color:#fecd24"><b>Article Navigation </b><br /> <br />
<select id="nextpage2" onchange="jumpnext2({$insert['articlepage_id']})">
{$second_toc}
</select>
</p>
{$insert['articles_pages_pagenav']}</div>
PHP Part
global $database;
$result = $database -> dbquery( "SELECT articlepage_page, articlepage_title FROM " . DB_PREFIX . "esselbach_ct_articlespages WHERE articlepage_article = '" . intval( $insert[ 'article_id' ] ) . "' AND NOT(articlepage_title = '') ORDER BY articlepage_page" );
$second_toc = "";
while( list( $insert[ 'articlepage_toc_page' ], $insert[ 'articlepage_toc_title' ] ) = $database -> dbrow( $result ) )
{
$sel = ($insert['articlepage_page'] == $insert['articlepage_toc_page']) ? " selected=\"selected\"" : "" ;
$second_toc .= "<option value=\"{$insert['articlepage_toc_page']}\"{$sel}>{$insert['articlepage_toc_title']}</option>";
}
1 Re: TOC formatting
Philipp
From: Austria
Administrator
1342From: Austria
Can you post your modified TOC templates? There are no page numbers and secondary TOC element in the default installation of Contentteller.
I have two things that are on my mind to be solved. They are only small!
Number 1
On our site when looking at an article. When you are on a specific page, inside the TOC (located at top of article) the "Page 2:" element disappears from the list. Is it possible to keep this?
I know it helps to identify which page you are on but I think it looks a little untidy. Could you tell me how to add a bold element to the page we are currently on too?
Number 2
The TOC element located at the bottom of an article does not have any "page 1:" "page 2" etc before the page title. Is it possible to add the same formatting as the TOC in number 1 above: Page number and when on a page it appears bold in the list?
Thanks for your help with this ! Happy New Year!