TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 19, 2024, 07:32:51 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 128
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 53
  • Total: 54
  • @rjen

Paging articles in TP

Started by hyem, February 13, 2008, 12:48:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hyem

Creating paging articles in TP, it's really needed inorder to creating some big content or review in one articles

like this :

first page here. (introduction)
<!--pagebreak-->
second page here. (detaill product)
<!--pagebreak-->
third page here (benchmark)
<!--pagebreak-->
etc,.. etc,..


any chance to do it?
- Enable paging for the content types we want to use it on.

IchBin

No chance of getting in in TP 0.9.8, but I think Bloc has plans for multi-page articles in TP 1.0

hyem

Wow,.. if it's really come with TP 1.0, that would be great than,.. can't wait to see it :(

Elrond

There are ways of making multi-page articles, using gets or requests ($_GET['sa'] or $_REQUEST['sa'], making sure to secure them of course so no one pulls script hacks).

Every article uses an unique id ($story['id']) and so, for example, a sub-page's link could look like this...

$link_array=array('1' => 'Main Article', '2' => 'Basic CSS', '3' => 'Advanced CSS');
echo '<div class="titlebg">';
foreach($link_array as $num => $title)
echo '<span class="maintab"><a href="' . $scripturl . '?page=' . $story['id'] . ';subpg=' . $num . '" title="'.$title.'">'.$title.'</a></span>';
echo '</div>';


To change content for each page you put something like...

if(empty($_REQUEST['subpg']) || $_REQUEST['subpg']=='1'){ /* Main Page Content Here */ }
else if($_REQUEST['subpg']=='2'){ /* Second Page Content Here */ }
else{ /* Whatever...hacking attempt or something. */ }


...being certain that requests are secured in any way necessary.

hyem

What about paging with drop down navigation? how to create it?