(2015-11-28, 08:55:55)mvlcek Wrote: I have created the I18N OnePage plugin to simplify the creation of single page themes. ...
Hi mvlcek
I have quickly checked out your OnePage plugin v02.
Everything looks good, EXCEPT you have a typo in Onepage thread post … which causes a TOTALLY BLANK html page .. Reason : In the forum OnePage plugin thread post for the while loop code to set the OnePage content with slugs in menu order you call return_i18n_structure() … but it looks like return_i18n_structure() DOES NOT EXIST. Instead return_i18n_page_structure() exists … do you mean this ?
I also noticed you have the same typo in i18n_navigation.php (v329) (the probable reason for above typo) : In the public functions comment header you have “return_i18n_structure()” but in the code in the same file there is no such function. Instead there is “return_i18n_page_structure()” … I assume you mean this
a. So using return_i18n_page_structure() instead of return_i18n_structure() I used the following template code … and all works well :
PHP Code:
<head>
......
<! Setup OnePage content here -->
<?php
$slugs = array();
$pages = return_i18n_page_structure(); // Was return_i18n_structure() but does not exist
foreach ($pages as $page) {
$slugs[] = $page['url'];
}
set_onepage_content(false, $slugs);
?>
<!-- Insert meta tags Keywords, Description -->
<!-- or <?php // get_header(); ?> -->
<?php get_i18n_header(); ?>
</head>
<body>
.....
<div id="page-content">
<!-- Insert OnePage content here -->
<?php while (has_onepage_content()) { ?>
<a name="<?php echo(return_onepage_slug()); ?>"></a>
<h2><?php getPageField(return_onepage_slug(), "title"); ?></h2>
<?php get_onepage_content(); ?>
<?php } ?>
</div>
.....
</body>
b. All works well …
i. set_onepage_content(false, $slugs) works well … with a manual list of slugs works well
ii. Frontend language switching all works well (I currently have English and German )
iii. The get_onepage_content() while (has_onepage_content()) works well, and the filter replace of the (% gallery %) tags (and the filtering for other plugins I have) is good, and also the language switching of gallery captions is working
c. Suggestions - I know the following is not part of your plugin but it could be useful info … so that everything is in one place
i. I think the default Use Case for the Onepage plugin will be to a) display all Backend (menu displayed) pages in one, and b) have a menu with anchor hrefs which link to each page part in the OnePage page .. Do you think so ?
ii. So if so, how about show this in the forum plugin post .. a) include an <a> tag line in the display while loop that you already have :
<a name="<?php echo(return_onepage_slug()); ?>"></a>
iii. Explain about setting in the Backend the Custom Permalink Structure textfield to #%slug% …
iv. Don’t include in the menu / OnePage the index page because the url for the index page would be <root> and not <root>/#index (unless that could be changed ?)
v. Also what’s the situation with template file choice in the Backend for each page ? For a normal multipage solution, you can choose a different template file for each page, but obviously for a OnePage solution it makes no sense to define different template files . .. I guess if you do, something must get ignored .. I have not experimented .. I have only used one file - the default template.php. So for a OnePpage solution what is the exact instruction for how to define the template file in the Backend ?
Cheers Aldebaran