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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,982
  • Total Topics: 21,320
  • Online today: 1,357
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 1071
  • Total: 1071

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?

This website is proudly hosted on Crocweb Cloud Website Hosting.