Notice

This old forum is now only available for consultation/read. User accounts on this old website are blocked.
Please create a new account on seblod.com and use the new forum http://www.seblod.com/community/forums.
Apologies for this perturbation and thank you for your understanding!
Welcome, Guest
Username Password: Remember me

how to create multi page content
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: how to create multi page content

how to create multi page content 2 years, 6 months ago #1

  • zorojan
  • ( User )
  • OFFLINE
  • Junior Boarder
  • Posts: 36
I'm building a web site reviews and a very important system of a page break with a drop down menu navigation.
Standard plug-in "pagerbreak" is not working properly,
All additional fields are displayed only on the last page

Re: how to create multi page content 2 years, 6 months ago #2

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
There's no out of the box way that I know of, but it shouldn't be too hard with a custom template. The idea is to add links to the different pages with the current page plus a url parameter for each page. Each link would look something like www.mysite.com/article.html?page-2. This could easily take the form of a dropdown menu like: css-tricks.com/unobtrusive-page-changer/

Then do a switch statement and depending on the url parameter, display each page's content.

Make sense?
The following user(s) said Thank You: zorojan

Re: how to create multi page content 2 years, 6 months ago #3

  • zorojan
  • ( User )
  • OFFLINE
  • Junior Boarder
  • Posts: 36
creation of the drop down menu is the secondary task.
If I create drop down menu, anyway the content does not display in proper layout.
The problem is that page break is not working properly "<hr class="system-pagebreak" title="The page title" />"
My example:
1.In page 1 and page 2 links - additional fields are not displayed

page1.jpg


2.In last page link - additional fields are displayed but not in proper way (they are situated in the bottom of content)

page2.jpg


3.only in "all pages link" - everything is working perfectly

all-page.jpg


Help please where can i find solution
problem for template or fields positions or need other plugin for pagination ?

Re: how to create multi page content 2 years, 6 months ago #4

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
Hi Zorojan, I gave you the solution above. You can't use the page break plugin in with Seblod. Instead, create separate editor (and/or other) fields for "page 1", "page 2" , "page 3" etc. You could use a groupx if you wanted in order to set different numbers of pages for different articles.

The next step is done in a custom template. You need to create your own links to the different pages (whether they are plain links or a dropdown, that's up to you). Using a switch or IF statement, you'll need to test for the url parameters you added in your links. Your code might look something like this (on a very basic level, no groupx or dropdown):

<!-- page links... note, these could but don't have to go at the top. If you want more control of template, place with each page in the switch statement below. If don't want to repeat it each time, you could make an include -->
 
<a href="<?php echo JURI::current(); ?>?page=1">Page 1</a><br />
<a href="<?php echo JURI::current(); ?>?page=2">Page 2</a><br />
<a href="<?php echo JURI::current(); ?>?page=3">Page 3</a>
 
<!-- JURI::current returns the current full link -->
<!-- end links -->
 
<?php
 
$link=JRequest::getVar('page');
 
<!-- JRequest::getVar is the Joomla way to query the url string or POST, like $_GET -->
 
switch ($link)
{
case 1:
//your fields and template for page 1
break;
case 2:
//your fields and template for page 2
break;
case 3:
//your fields and template for page 3
break;
default:
//your fields and template for page 1
}
?>
 


Hope that helps!
Last Edit: 2 years, 6 months ago by unleash.it.

Re: how to create multi page content 2 years, 6 months ago #5

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
Another way to do this would be to load all of the information for all pages at once, and then use javascript or jquery to only show one page at a time, using tabs or some other UI.

www.seblod.com/support/forum/108-Tips-an...ERE-with-jquery.html tells how to do it (you could use a tabs plugin instead of my query script if you prefer).

Either way, you still need to divide your pages up into different fields, but this is much more powerful than the pagebreak plugin anyway because you can achieve a more precise layout from your content managers. Putting everything into one editor is really hard to manage IMO.

Re: how to create multi page content 2 years, 6 months ago #6

  • zorojan
  • ( User )
  • OFFLINE
  • Junior Boarder
  • Posts: 36
1)I’m trying to understand how you describe the problem I had in the template as you mentioned (host/templates/gk_twn2/html/com_content/article/defoult.php) but didn’t understand what code I need to put in the switch-> case ( get value URL's page 1.2.3 ?) .
If so, I have to create 3 such articles for each publication to have a separate URL and connect them with drop down menu on another form of content. But this option looks like more the drupal Book Module and not the Multi Page Content Form.
2)Tabs (or other script) is working properly but it's not a solution to multi page contents. and as the content is pretty large, using Tab the SEO process is going very uneffectively. tabs ideal for small article.
I can see the following as the way to solve the issue:
criteria for multipage content from.

parameters for main page - main URL, main title, intro text, metadata and other basic standard fields.
parameters for subpage - sub URL(main URL+pagination code), sub title ( main title+title page # ), body (text area)
Example to show page 2
(show main parameters and switch parameters subpage field )
URL= "main URL+pagination code"
Title = "main title+title page 2"
body= "text area- body"
other fields = main parameters

Re: how to create multi page content 2 years, 6 months ago #7

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
Hi Zorojan, I mean a Seblod template, not a Joomla one. If you want to try my idea, you'll have to have some basic php, html, and css knowledge. If you do, you should start here:

www.seblod.com/support/documentation/seblod-2x/templates.html

To begin to get familiar with Seblod templating (overrides). Especially check out the templating 101s to begin. Once you go through that, I think you'll understand what is supposed to go in the switch statement. Basically, each case is a page of your your article. You need to call your seblod fields you'd make in your content type like $cck->get('page1_title')->value and $cck->get('page1_editor_field')->value; along with the markup (html) you need.

If you really want 3 separate pages with separate meta tags, etc. on each page, the page break plugin wouldn't do that anyway. The method I explained would use the same meta data for all of the pages, but it would refresh the page and call only the each page's data (so it would solve the performance issue).

The only solution that I can think of to do everything you are asking would be to create a category for each page, then create separate articles for each "page" of the article, place them into all into the same category, then create a category blog or seblod search for the "category" (really the page). You could probably get the look and feel that you need, as long as you didn't mind how it was set up.
Last Edit: 2 years, 6 months ago by unleash.it.

Re: how to create multi page content 2 years, 6 months ago #8

  • zorojan
  • ( User )
  • OFFLINE
  • Junior Boarder
  • Posts: 36
Hi unleash
You helped me a lot and gave a correct direction
I have spent a lot of time looking for the solution of my described problem and that brought me to the Seblod.
I will learn Seblod templating and develop an ideal solution instead of using an easier one.
Returning to the metadata, probably , I haven't manage to explain my problem correctly, only Title and body must change in different pages. You can see sample of my desired pagination in
www.tomshardware.com/reviews/geforce-gtx...-benchmark,3193.html

I will keep you informed as soon as I succeed
thanks for your involvement in this topic

Re: how to create multi page content 2 years, 6 months ago #9

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
Hi Zorojan, funny Tom's Hardware is always the site that comes to mind for me to for this. I see they changed from a dropdown menu nowadays...haven't been there in awhile.

What I'm suggesting with a Seblod template and creating your links should get you 95% of the way there. You can defeintely have different titles at the top of each page (by collecting the titles as seperate fields in the content type. But it's a bit more tricky if you want the html <title> to change. I'm sure it's possible with some J framework code, but I don't know exactly how. I would try to ask that question seperately (either here at Seblod or maybe easier on the Joomla forum). Personally, I don't think having a different head <title> for the subpages is important for SEO. I wouldn't want my visitors arriving on a subpage anyway, I'd rather have them arrive on page 1.

By the way the most elegant way to do this would be with a groupx. With a groupx, you could have fields for page title, main content (probably an editor field), image, etc. Then when someone goes to add the article, they would just click a (+) for each page and have as many or few as they needed. Groupx would be a bit harder to code in your custom template along with the switch, but not that bad... the template help has a page for how to call groupx.

Once you get a working copy, you could even export it and offer it on the Seblod Market... if it ever comes out
Last Edit: 2 years, 6 months ago by unleash.it.
The following user(s) said Thank You: zorojan

Re: how to create multi page content 2 years, 6 months ago #10

  • zorojan
  • ( User )
  • OFFLINE
  • Junior Boarder
  • Posts: 36
success so far is not very good but there is news
I wrote this code and got the same result.
<a href="<?php echo JURI::current(); ?>?page=1">Page 1</a><br />
<a href="<?php echo JURI::current(); ?>?page=2">Page 2</a><br />
<a href="<?php echo JURI::current(); ?>?page=3">Page 3</a><br />
 
<?php
 
$page = JRequest::getVar('page', 0);
 
 
$content = $cck->getValue('art_fulltext') ;
 
$steps = explode(':page:', $content);
 
 
if(array_key_exists($page, $steps))
{
echo $steps[$page];
}
else
{
echo "Sorry, page has not been found!";
}
 
?>


Not working normal and it turned out that the problem into a sequence (order) of positions. shows only those field that are inserted in positions above fulltext (page break fields).
if the textfield (page break) want to insert a at below of the rest the fields then do not write anything. Standart page break also works well
the solution must be found in the group x, but if it does not work in group x also will not work.
in terms of "SEO" i am thus eliminating duplication of titles is very important for search engines

Re: how to create multi page content 2 years, 6 months ago #11

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
Hi Zorojan,

I don't understand what you are doing with your code. The $page variable is not an array, so why are you trying to explode? If you code your links like I did, $page will simply return the current page number of the article (or nothing if default). I think you're making it more complicated then it is.

Have you tried coding it like my example? For now, I recommend that you try to skip the groupx. For now, just pretend that there will always be 3 pages. Once you get it down in a simple way, then try to achieve with the groupx. I'm certain that it's possible to do, its just easier to start simple IMO!

Re: how to create multi page content 2 years, 6 months ago #12

  • zorojan
  • ( User )
  • OFFLINE
  • Junior Boarder
  • Posts: 36
Hello unleash finally works like you said. many thanks

paste code to /templates/seb_one/positions/bottombody.php
//drop down menu in top of page
<form>
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option value="">Go to page...</option>
<option value="<?php echo JURI::current(); ?>?page=1">Introduction</option>
<option value="<?php echo JURI::current(); ?>?page=2">Test report</option>
<option value="<?php echo JURI::current(); ?>?page=3">Conclusion</option>
</select>
</form>
 
//switch
<?php
 
$link=JRequest::getVar('page');
 
 
switch ($link)
{
case 1:
echo $cck->getValue('art_fbody_1');
break;
case 2:
echo $cck->getValue('text_body_2');
break;
case 3:
echo $cck->getValue('text_body_3');
break;
default:
echo $cck->getValue('art_fulltext');
}
?>
 
// navigation in bottom page
<a href="<?php echo JURI::current(); ?>?page=1">Page 1</a><br />
<a href="<?php echo JURI::current(); ?>?page=2">Page 2</a><br />
<a href="<?php echo JURI::current(); ?>?page=3">Page 3</a><br />


multi-page.jpg


now we have to make them dynamic, ie "group x / field x"
on "group x / field x" i can not find proper documentation for only the creation of gal,
where there are instructions on how to use and what type it is supported
i need used in group x
type - wysiwyg editor and text for group (Article Title, Article alias, Article Fulltext )
Last Edit: 2 years, 6 months ago by zorojan.

Re: how to create multi page content 2 years, 6 months ago #13

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
Hey good news!

Unfortunately I'm really busy at the moment and it would take some time for me to properly code, test and teach you how to use and set up a groupx (you need a groupx not fieldx, because you need at a minimum a title plus an editor field for each page). Because that's a lot for me until next week, I'd suggest first setting up a more usual groupx.

If you want to practice first, create a test content type called gallery-x, and another called gallery. In gallery x, create an image field and a text field (for caption). Don't forget to place them in admin, site, content and intro. Then in the GALLERY content type, create a new group-x field and place it in the views you need it (I think at least admin and content). Create other fields for the fun of it. Next add some gallery articles to the gallery content type, and create a menu item to it. Then create a position override to make a custom template for at least the article (content) view. See the template help, there's plenty of info. This page explains how to call the groupx part: www.seblod.com/support/documentation/seb...eldx-and-groupx.html

If you do the practice, I'll bet you'll start to get a good feel for what you need to do for your multi-page template.

Probably the best way to handle it would be to loop trough the groupx twice. First time for the menu, you would echo an <option> for each item in groupx, and add a $count++ to display the page number. Don't create a 3rd groupx for the bottom menu, try to put your html into a variable so you can reuse.

I think you'll need to loop through groupx a second time for the switch.

Last piece of advice for now, you might add a little more html markup to the template so you can style with css easier. Example:

<div class="topnav">
<form>
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
<option value="">Go to page...</option>
<option value="<?php echo JURI::current(); ?>?page=1">Introduction</option>
<option value="<?php echo JURI::current(); ?>?page=2">Test report</option>
<option value="<?php echo JURI::current(); ?>?page=3">Conclusion</option>
</select>
</form>
</div>


and

case 1:
echo '<div class="page"> . '<h1>' . $cck->getValue('page_title_1') . '</h1>' . '<div class="page-text">' . $cck->getValue('art_fbody_1') . '</div></div>';
break;


Of course this will all change once you add the groupx, but that's the general idea. If you give it a shot and still need help, I'll be available again next week.
Last Edit: 2 years, 6 months ago by unleash.it.

Re: how to create multi page content 2 years, 6 months ago #14

  • zorojan
  • ( User )
  • OFFLINE
  • Junior Boarder
  • Posts: 36
hi teacher
i created
group X (sub_title , sub_fulltext)
and called for in new_article form

how to display only one fulltext (sub_fulltext field ) in "new_article content type" custom template .
Choice of sub_title

in two words
i only need to learn how to get single sub_fulltext field (filter sub_fulltext field)
The rest i will try to understand by myself

Re: how to create multi page content 2 years, 6 months ago #15

  • unleash.it
  • ( User )
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
Ha, actually that's what I am...or try to be...in real life. well, I think you should take my advice and first worry about a normal groupx. You can get plenty of help with that from old forum answers (actually the other topic you posted was related to a bug that got fixed), or by posting new ones about your simple groupx.

I don't understand your question, but I think if you tried to tackle a normal and simple groupx like I mentioned above you'd get it (and maybe study a little php and how the foreach loop works, if you don't know already). Sorry but that's all I have time for for the next couple of days...

I'm not sure where your php skills are, but this could be a big help for a lot of things: www.w3schools.com/php/default.asp

Once you're up to speed on basic php, foreach loop and basic arrays, this will make more sense and I think you'll understand what you can do with it:

www.seblod.com/support/documentation/seb...eldx-and-groupx.html
Last Edit: 2 years, 6 months ago by unleash.it.
  • Page:
  • 1
  • 2
Time to create page: 0.58 seconds