hello developers - change symbols for {} at {loadposition x}
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sun Mar 01, 2015 6:34 pm
hello developers - change symbols for {} at {loadposition x}
Hello!
I'm using the extension Direct PHP to embed a browserfork in a custom html jommla 3 module. The browserfork has an if - else condition and fires two different echo commands. In the echo command i use the {loadposition position-x} code from native joomla core. This does unfortunatly not work becouse the php parser of Direct PHP interpretates such braces differently and throughs an error.
If i backslash the braces \{ or "{" or use { and } it's simply displayed as text without loading the module.
Is it possible to exchange the braces from {loadposition xy} to another sign somwhere in the core code for example to [loadposition xy] or €loadposition xy@ ?
Or do you have another idear?
Thanks in advance and for your support at my interesting project.
I'm using the extension Direct PHP to embed a browserfork in a custom html jommla 3 module. The browserfork has an if - else condition and fires two different echo commands. In the echo command i use the {loadposition position-x} code from native joomla core. This does unfortunatly not work becouse the php parser of Direct PHP interpretates such braces differently and throughs an error.
If i backslash the braces \{ or "{" or use { and } it's simply displayed as text without loading the module.
Is it possible to exchange the braces from {loadposition xy} to another sign somwhere in the core code for example to [loadposition xy] or €loadposition xy@ ?
Or do you have another idear?
Thanks in advance and for your support at my interesting project.
- xfsgpr
- Joomla! Ace
- Posts: 1099
- Joined: Mon Feb 14, 2011 4:02 am
- Location: London
Re: hello developers - change symbols for {} at {loadpositio
Have you tried using this instead?
Code: Select all
{ for {
} for }
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sun Mar 01, 2015 6:34 pm
Re: hello developers - change symbols for {} at {loadpositio
thank you for your suggestion... i just tried, but {loadposition xy} was displayed as plain text without loading the module.
The module is displayed if the {loadposition xy} is in normal text instead ... i guess within a php echo '...' there are no {} allowed cos the php parser thinks it's a regular php command and no joomla shortcode.
with your suggestion i tried all alternative writings for those { } with the result that the shortcode is displayed instead of the module. use direct {} throughs an error.
I think the only solution that is left is to change the shortcode in the joomlacore to avoid the misunderstanding of the php parser. Do you know where in the joomlacore the shortcode or more exactly the {loadposition ...} is defined, so that i can replace the {} with [] for example?
The module is displayed if the {loadposition xy} is in normal text instead ... i guess within a php echo '...' there are no {} allowed cos the php parser thinks it's a regular php command and no joomla shortcode.
with your suggestion i tried all alternative writings for those { } with the result that the shortcode is displayed instead of the module. use direct {} throughs an error.
I think the only solution that is left is to change the shortcode in the joomlacore to avoid the misunderstanding of the php parser. Do you know where in the joomlacore the shortcode or more exactly the {loadposition ...} is defined, so that i can replace the {} with [] for example?
- Per Yngve Berg
- Joomla! Master
- Posts: 30886
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: hello developers - change symbols for {} at {loadpositio
Where are you using the {loadposition xy}, inside an article?
Because it does not work inside custom html modules.
Because it does not work inside custom html modules.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sun Mar 01, 2015 6:34 pm
Re: hello developers - change symbols for {} at {loadpositio
{loadposition xy} does indeed work in a custom html module... i tried out!Per Yngve Berg wrote:Where are you using the {loadposition xy}, inside an article?
Because it does not work inside custom html modules.
but now i need to load mp3s and oggs differently depending on browsers...
and therefor i need a php browserfork wich two if else echo '...' commands which loads different modules depending on browser... please read complete post
but it does not work inside costom html module AND php echo command ... if(http.user.agent==...) echo {loadposition xy} does not work becouse of a conflict between the joomla parser and the standard php parser...
i still think i got to exchange the "{ }" in the core files with sth. else...
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sun Mar 01, 2015 6:34 pm
Re: hello developers - change symbols for {} at {loadpositio
is there any joomla developer who can tell me where the according core file is located? can someone ask someone?
Re: hello developers - change symbols for {} at {loadpositio
Do not core hack the plugin that's responsible for this feature to change the brackets. Core hacking is *NEVER* a solution.
Luckily though, the plugin is pretty easy to copy. Simply copy the folder the plugin is in, give the plugin and the XML and PHP files a new name (all must match) and adjust the class name of the plugin class to match your new name. Congratulations, you've successfully forked the plugin. Now you can make your changes in this plugin, which will not get overwritten on a core update. But, be forewarned; you will be required to maintain this plugin and any bug fixes that get merged to the core plugin will be your responsibility to merge into your customized plugin.
Luckily though, the plugin is pretty easy to copy. Simply copy the folder the plugin is in, give the plugin and the XML and PHP files a new name (all must match) and adjust the class name of the plugin class to match your new name. Congratulations, you've successfully forked the plugin. Now you can make your changes in this plugin, which will not get overwritten on a core update. But, be forewarned; you will be required to maintain this plugin and any bug fixes that get merged to the core plugin will be your responsibility to merge into your customized plugin.
- Per Yngve Berg
- Joomla! Master
- Posts: 30886
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: hello developers - change symbols for {} at {loadpositio
Why don't you use a video-player Plugin?
http://extensions.joomla.org/extensions ... /allvideos
PS. since you already are using php, you can load the module with the Joomla api call.
http://https://api.joomla.org
http://extensions.joomla.org/extensions ... /allvideos
PS. since you already are using php, you can load the module with the Joomla api call.
http://https://api.joomla.org
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sun Mar 01, 2015 6:34 pm
Re: hello developers - change symbols for {} at {loadpositio
thank you for this tip mbabker...mbabker wrote:Do not core hack the plugin that's responsible for this feature to change the brackets. Core hacking is *NEVER* a solution.
Luckily though, the plugin is pretty easy to copy. Simply copy the folder the plugin is in, give the plugin and the XML and PHP files a new name (all must match) and adjust the class name of the plugin class to match your new name. Congratulations, you've successfully forked the plugin. Now you can make your changes in this plugin, which will not get overwritten on a core update. But, be forewarned; you will be required to maintain this plugin and any bug fixes that get merged to the core plugin will be your responsibility to merge into your customized plugin.
Per Yngve Berg
https://api.joomla.org can you tell me where ca to find the php module api call?
Global (\)
Composer
Joomla
Packages
Global (\)
Joomla.Platform
Joomla.Libraries
Joomla.Legacy
Default
? ??
- Per Yngve Berg
- Joomla! Master
- Posts: 30886
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway