2011-05-03, 06:11:32
grumpygamer Wrote:Hello,
I am thinking about using GS to power my web agency and I am finding it fun and fairly simple.
Though I have stumbled across an issue right now.
I need to enclose multiple pages in one, clicking the menu will scroll down to the anchor point, but I need the pages to edit separately in the admin
How can I accomplish that?
Thanks
- gg
One solution:
- Install the I18N Plugin
- Install the I18N Custom Fields plugin
- Install the DynPages plugin
- Goto administration Theme/Edit Theme and ensure that you use get_i18n_navigation(return_page_slug()) to display the menu.
- Goto administration Plugins/Configure Custom Fields and add a field with name link, label Link and type link and save
- Goto administration Theme/Edit Components and add a component page with the following code:
Code:
<?php
global $args;
get_i18n_content($args[0]);
- Create your separate pages with Slug/URL e.g. page1, page2, page3
- Create a combining page with Slug/URL page1-3 with the following HTML source code and add it to the menu:
Code:
<a name="page1"></a>
{% page page1 %}
<a name="page2"></a>
{% page page2 %}
<a name="page3"></a>
{% page page3 %}
- Add page2 and page3 (but not page1) to the menu and set their custom field link to /page1-3#page2 and /page1-3#page3 (fancy urls assumed, otherwise it's /index.php?id=page1-3#page2 etc.)
I didn't try it, but this should work. The current menu item will always be that for the page page1-3.
Background:
- I18N Custom Fields allows you to define custom fields for your page
- I18N uses the field link instead of the path to your page, if set
- DynPages allows you to call components with php code from within your page
- The created component displays the content of the page passed as parameter