We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Is there a list of variables? | Forum

Topic location: Forum home » Support » General Questions
James Geddes
James Geddes Apr 16 '15
Hi everyone,


Is there a list of variables? I'm trying to customise the email templates and would like to know what they all are and what they translate to meaning. For example;


{$realName}

{$username}

{$password}

{$site_url}

{$sender}

{$site_name}

...and all the others


Thanks!


James

dave Leader
dave Apr 16 '15
No there is no list of variables that i know of.  
Taissa Team
Taissa Apr 17 '15
James Geddes, here is the full list of existing global variables:
{$user_name}
{$user_email}
{$site_name}
{$site_url}
{$site_email}
{$unsubscribe_url}

 If you want to add an additional global variable, we suggest to develop the plugin and you can find this post useful as well: http://www.oxwall.org/forum/topic/11098?page=1#post-56315

If I took you wrong - please provide me with more details. 
James Geddes
James Geddes Apr 19 '15
I need to know what these all mean and what the difference between {$realName} and {$username} is


Thanks!

dave Leader
dave Apr 19 '15
In oxwall there is an option in admin to use realname or username in display.  For privacy many admins choose realname because its like nickname  and it keeps your username from display for privacy.    So for instance on my reg form i changed it to read nickname and username so that they can lets say have a username of simplesimon but a nickname of ted.   Username is the name they sign on with.  Nickname or realname is the name that is displayed if that option is chosen in admin. 
The Forum post is edited by dave Apr 19 '15
James Geddes
James Geddes Apr 22 '15
Thanks for that Dave! It would be great if there was a translation table for all the variables in the docs, ie, a table that lists;


"This variable" | "Means this"

dave Leader
dave Apr 22 '15
i guess you could output a  get_defined_vars()   http://php.net/manual/en/function.get-defined-vars.php  you might be able to track it from there. 


The Forum post is edited by dave Apr 22 '15
dave Leader
dave Apr 22 '15
also a good search utility like Agent Ransack will save your life many times over. 
James Geddes
James Geddes Apr 22 '15
These solutions that are very tech-person orientated. Surely Oxwall should, in general, be aiming to be as user friendly as possible? We have moved away from wordpress because it is pants at fostering a community, however, the usability that it provides is fantastic.
dave Leader
dave Apr 22 '15
Oxwall certainly does not require you to be tech savy to have a website, it is written in a way that just about anyone can use it.  


However with that said you will be pressed to know other knowledge being a site owner if you have your own hosting or server.  


So you are quite correct that Oxwall does not require, but the environment you are on may require it.  Especially if you are going to open the tech door venturing into plugins and special mods, it comes with the territory :)

James Geddes
James Geddes Apr 22 '15
I'm not asking for "other knowledge", I was asking for the placeholders and what they mean. In mailchimp and wordpress, for example, this is done with drag and drop, whereas in oxwall it is still done in code. This is nothing to do with the environment in which one is running the software, it is how the software is built.


While I am very impressed by all the features that oxwall does offer, I am not alone in being disappointed by its usability.

James Geddes
James Geddes Apr 22 '15
I don't mean to be negative though, on the whole, oxwall is amazing :)
Taissa Team
Taissa Apr 23 '15
James Geddes, thank you for your feedback.
There are simple standard variables that can be used for mail templates to insert members' usernames, emails, etc automatically.

{$user_email} - the email which user entered in the registration form
{$site_name} - the Site Name field in Admin Area>Settings>Main Settings>Basic tap.
{$site_url}  - OW_URL_HOME in the ow_includes/config.php file
{$site_email} - the Site Email  field in Admin Area>Settings>Main Settings>Basic tap.
{$unsubscribe_url} - provides unsubscribe link from Mass Mailing. 

Be note You cannot use this variables on your custom pages.
And also you can find all documentation we have for now here: http://docs.oxwall.org/dev:index .
Sean
Sean Apr 23 '15
I've noticed that in the latest version the {$site_url} variable does not work as expected.


For example, my header image uses the variable so that users can click it to return to the index page easily.


However, say for example I go to the Events page, the {$site_url} variable now goes to mysite.com/events, the same if I were to visit photos mysite.com/photos etc.


This makes the site_url variable pretty useless.

The Forum post is edited by Sean Apr 23 '15
Taissa Team
Taissa Apr 24 '15
Sean, could you specify where did you paste {$site_url} variable.

Such variables as {$site_name} or {$site_url} can be used only when they are backed up by certain .php functionality.  Custom html widgets are independent components that "understand" only .html language. Content added into those components is not connected to any .php functionality and therefore can not pull values of variable such as {$site_name} or {$site_url} from the database. As a result system will treat such variables in custom .html widget or in HTML files as plain text.
Sean
Sean Apr 24 '15
Humm, I'm trying to use it in a theme, so that the header image acts as a button back to the index page.


Is there a way I can assign the site url variable to the general.html template file?

Taissa Team
Taissa Apr 24 '15
Just add this code  <a href="{$siteUrl}"> the header image code</a> to the header image block in the general.html template file.