Search

Comment deleted.

I have Symphony in a sub-folder of my local site.

$root returns ‘http://root/sym

I just want ‘http://root/’ so I can reference resources outside of the Symphony folder using ‘$site-url’.

Code like this works for WordPress in a sub-folder to set $SERVER[“DOCUMENTROOT”] correctly (A fix for IIS):

if(!isset($_SERVER['DOCUMENT_ROOT'])){ if(isset($_SERVER['PATH_TRANSLATED'])){
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\', '/', substr(str_replace('\\', '\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
}; };

How would I do this to set $site-url parameter to ‘http://root/’ using this extension?

Testing, a backslash () returns some unicode character!

I’d say

return 'http://' . $_SERVER['SERVER_NAME'] . '/';

That works fine @phoque. Not bad for a 13 minute correct solution. Cheers.

I did have a couple of issues:

I named the set ‘PHP variables’.

Clicking ‘Add item’ had no effect.

‘Create’ returned the page with option to fill in parameter, highlighted as an error.

‘Create’ returned an error page referring to excluded pages.

Excluding a page I did not really want to fixed the problem.

I did a lot to try and get this kind of thing working, but I’ve just lost loads of ‘playground’ projects in a backup nightmare.

It’s not th document root you have to worry about, rather the http root.

The way I tried, if I remember rightly, is to use an .htaccess file at the root silently redirecting any requests to the /sym folder like so:

Options +FollowSymlinks

<IfModule mod_rewrite.c>

    RewriteEngine on
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*/?)$ sym/$1    [L]

</IfModule>

Leaving your Symphony .htaccess where it is. Then, in the index.php under /sym find line 4

define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '\/') . dirname($_SERVER['PHP_SELF']), '\/'));

And replace it with

define('DOMAIN', rtrim($_SERVER['HTTP_HOST'], '\/'));

I can’t remember if it worked or not, but give it a go…

Just a note to anyone looking to use this extension in its current form with Symphony 2.1.2.

You can solve most of the issues raised by Willabee above by applying the fixes mentioned by other Symphony users in the Github issues list for the project.

The ‘Add item’ issue however seems to be specific to 2.1.2 and is CSS related. When you click the ‘Add item’ button the fields are being created, they’re just not visible due to the following default rule:

.subsection li.template { display:none; }

In 2.1.1 the fields have an inline display:block declaration which overrides the above, but in 2.1.2 this inline rule doesn’t appear to be getting added.

I’m not sure where this needs to be fixed, so in my own case I just temporarily forced the fields to display using Firebug prior to submit.

Doesn’t there need to be some JQuery magic to animate them into display?

I think this might need the JS working group to look at, since the generated HTML looks quite different between the two duplicators. I’m worried that duplicators in the core changed slightly, but duplicators in extensions (such as this, Email Template Filters, Search Index and others) may be implemented a slightly different way.

Issue #428 created

in symphony v2.1.2 dont work :/

What about it doesn’t work? Do you get any error messages, or do no parameters appear when pages load? Or does the interface for creating parameters not work? What parameters are you trying?

It works, but I’ve noticed a little bug, you have to set one page that to exclude the Global Parameters from and then it works. alt text

If you don’t set an excluded page, it gives you an error.

implode() [function.implode]: Invalid arguments passed
An error occurred in /home/user/site.com/public/extensions/globalparamloader/content/content.sets.php around line 90
85:             }
86:             
87:         // Save: --------------------------------------------------------------
88:             
89:             $this->_fields['params'] = (integer)count($this->_params);
90:             $this->_fields['exclude_page'] = implode(',', $this->_fields['exclude_page']);
91:             
92:             $this->_Parent->Database->insert($this->_fields, 'sym_gpl_sets', true);
93:             $this->_Parent->Database->update($this->_fields, 'sym_gpl_sets', "`id` = '".$this->_fields['id']."'");
94: 

NOTE: I posted this issue on the Global Parameter Loader issue tracker.

in symphony v2.1.2 dont work :/

AND

What about it doesn’t work? Do you get any error messages, or do no parameters appear when pages load? Or does the interface for creating parameters not work? What parameters are you trying?

For some reason the Add item link is not responding. You click on it, and it doesn’t respond at all. This only seems to happen on Symphony 2.1.2.

I did a quick screencast showing what happens (or doesn’t happen) when you click on the Add Item link.

NOTE: I submitted this as an issue on the Global Parameter issue page.

Ah this is a known issue with duplicators, so this extension needs an update. For a quick fix you should be able to remove a CSS rule that is hiding list items (I haven’t got code access now). I think there’s a display:none in there somewhere. There’s a closed bug on the main issue tracker discussing this which might be useful too.

Just a heads up for anyone who comes across this absolutely bizarre bug that had us scrambling for hours.

On some server setups, the use of @eval("blah") (Line 96) will cause the page to return a 500 error, but still load the page content as per usual.

This will however break Symphony Dynamic XML ds, and any jQuery AJAX, because the 500 appears that the page is broken.

We removed the whole eval code in our case because we don’t use any inline PHP functions, so it’s not a solution for the extension, but just something that people should be aware of.

I've forked cartsen's extension and given it a new lick of paint so to speak updating it to 1.2

  • Compatible with Symphony 2.2+
  • Resolve Issue #1 and #2 from Issue Tracker
  • Allow eval to be turned on/off through the preferences. The downside here is that you'll lose the ability for PHP expressions.
  • Allowed the extension to be localised!

I've sent a pull request, but in the meantime you can find it on my fork

@brendo, I'm trying your fork and at the moment values are just being passed through as strings without being parsed, for instance:

return ('test')

gives me a param of return ('test') instead of test. I've tried with under 2.2.1 and 2.2, is it just me?

Do you have the 'Allow eval of parameters...' turned on in the preferences?

I turned off the eval of parameters by default and made it optional as I was having issues (details in this thread)

Ah ha! I suspected it was something simple. Thank you very much.

Yah, those details 1) upgade on extensions page and 2) set that pref should definetly be added to the readme file on your fork if possible. thnx much, this is essential for my proj !

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details