Posts: 9
Threads: 3
Joined: Aug 2011
Still playing around with GetSimple and loving it. I would like to knew if there is a way to make this work.
call get_navigation(return_page_slug()) from a component ? When I attempt this it returns a error ?
example :
make a component named footer paste this in
Code:
<?php get_navigation(return_page_slug());?>
Thanks for any help.
Posts: 2,094
Threads: 54
Joined: Jan 2011
PMB Wrote:Still playing around with GetSimple and loving it. I would like to knew if there is a way to make this work.
call get_navigation(return_page_slug()) from a component ? When I attempt this it returns a error ?
example :
make a component named footer paste this in Code:
<?php get_navigation(return_page_slug());?>
Thanks for any help.
Which error? This should work (although you should put
<ul>...</ul> around it to get valid HTML).
Include the component in the template using
Code:
<?php get_component('footer'); ?>
Posts: 9
Threads: 3
Joined: Aug 2011
I was playing around some more. It is a sever security error. It will work on my localhost. But when I went live is when everything went bad.
Quote:Error 501: The server cannot complete the request because it encounters an error
Header values specify a configuration that is not implemented.
ModSecurity, web application firewall, possible secure attack prevention.
I have a work around working. But because i'm new to GetSimple, I'm just trying to learn best practices and what I can and can't do.
Thanks for the quick reply.
Posts: 2,928
Threads: 195
Joined: Feb 2011
please give us the info from the server health check .. you can find that in the settings / first steps
this menu navigation should never be a security risk ... I see the same danger as eating ice cream ... it is harmless ;=)
are you on a windows-server?
another question: a navigation belongs into the template, why you put it into a component?
Posts: 9
Threads: 3
Joined: Aug 2011
Hello again Connie.
health check is 100%. The above was just an example. Anywhere I try to include php (without hard coding it ). I get the above error. I'm on a linux server.
One nice reason I found to put the navigation in a component would be for a 3 col. footer. But yes I do understand your point about the template. I'm just try to test what I can and can't do.
Posts: 2,928
Threads: 195
Joined: Feb 2011
PMB Wrote:I'm just try to test what I can and can't do.
that's a good approach ;=)
Posts: 88
Threads: 9
Joined: Feb 2011
if you try to put PHP into a component, can you put any quoted strings there? For simplest example echo("text");? Since get_component() relies on both eval() and stripslashes() it will output unquoted string. Double backslashes to overcome it?
Posts: 2,094
Threads: 54
Joined: Jan 2011
2011-11-13, 02:21:25
(This post was last modified: 2011-11-13, 02:21:58 by nime.)
Ampersand Wrote:if you try to put PHP into a component, can you put any quoted strings there? For simplest example echo("text");? Since get_component() relies on both eval() and stripslashes() it will output unquoted string. Double backslashes to overcome it?
??? get_component works perfectly with single and double quoted strings, e.g. a component with
Code:
<?php echo "double".' single'; ?>
Posts: 88
Threads: 9
Joined: Feb 2011
yes echo works, so it must have to do with something different than escaping quotes. When I put a filename into a component,
Quote:component content
require_once("filename.php");
template content:
<?php get_component('componentname'); ?>
it stops page rendering.
However this way:
Quote:template content:
<?php require_once("filename.php"); ?>
it works fine, even with further call of filename functions in the template.