2015-11-23, 19:57:40
Hi mvlcek
I have a problem with the i18n Gallery plugin not converting the in-editor (% gallery %) tag syntax to actual js/html code.
Using latest Versions : GetSimple 3.3.7, i18n Gallery 2.2.1, i18n 3.2.9, with PHP – 5.4.16
Background : I am wanting to do a one page theme which is also multi-lang. For this I want to use the fn returnPageContent() in a loop. I would put this in a theme functions.php file .. along the lines of Carlos here.
(but just a function defn, then called from the template )
.. But if I use the fn returnPageContent() where there is a (% gallery %) tag in the page, it is NOT converted to the final code, but just left as is. I also tried getPageContent($page_slug) but this had the same result.
I have done a quick test shown below with no looping, but which just has 2 parts, one below the other. Part 1 is whatever is chosen by clicking a menu item and then simply calling get_page_content() which does any plugin filtering in the normal way. Part 2 is always the same page containing a gallery page with slug name gallery-page, and uses fn returnPageContent() and then calls the same get_page_content().
Code:
So THE PROBLEM is :
Case A : When Part 1 is any page except the gallery page, then the gallery tag in Part 2 is left UNCONVERTED
Case B When Part 1 is the gallery page itself, then the gallery tag in Part 2, as well as Part 1, IS converted
So the point is, even though with Part 2 I may not have prepared the $content string correctly with returnPageContent(), but the fact is that for both Cases A and B the code/values in Part 2 is IDENTICAL .. I re-initialise $content .. but case A does NOT WORK and case B DOES work ..
So what‘s happening ??
Any help would be great
Thanks Aldabaran
I have a problem with the i18n Gallery plugin not converting the in-editor (% gallery %) tag syntax to actual js/html code.
Using latest Versions : GetSimple 3.3.7, i18n Gallery 2.2.1, i18n 3.2.9, with PHP – 5.4.16
Background : I am wanting to do a one page theme which is also multi-lang. For this I want to use the fn returnPageContent() in a loop. I would put this in a theme functions.php file .. along the lines of Carlos here.
(but just a function defn, then called from the template )
.. But if I use the fn returnPageContent() where there is a (% gallery %) tag in the page, it is NOT converted to the final code, but just left as is. I also tried getPageContent($page_slug) but this had the same result.
I have done a quick test shown below with no looping, but which just has 2 parts, one below the other. Part 1 is whatever is chosen by clicking a menu item and then simply calling get_page_content() which does any plugin filtering in the normal way. Part 2 is always the same page containing a gallery page with slug name gallery-page, and uses fn returnPageContent() and then calls the same get_page_content().
Code:
Code:
functions.php code ...
function forum_test() {
global $content;
// Part 1 .. the NORMAL way
// ===========================
$content = "<h1>Part 1 </h1>".$content;
get_page_content();
// Part 2 .. my ONEPAGE way
// ==========================
// Note RE-INITIALISE $content
$content = "<h1>Part 2</h1>";
$content .= returnPageContent('gallery-page', "content", true, true);
get_page_content();
}
... and the template.php code :
<body>
<div id="page-container">
<?php forum_test(); ?>
</div>
</body>
.. and the gallery-page source code :
<h2>Gallery Start</h2>
<div>(% gallery name=gallery-1 thumb=1 id=g3 %)</div>
<h3>Gallery End</h3>
So THE PROBLEM is :
Case A : When Part 1 is any page except the gallery page, then the gallery tag in Part 2 is left UNCONVERTED
Case B When Part 1 is the gallery page itself, then the gallery tag in Part 2, as well as Part 1, IS converted
So the point is, even though with Part 2 I may not have prepared the $content string correctly with returnPageContent(), but the fact is that for both Cases A and B the code/values in Part 2 is IDENTICAL .. I re-initialise $content .. but case A does NOT WORK and case B DOES work ..
So what‘s happening ??
Any help would be great
Thanks Aldabaran