Customizing SMF > SMF Coding Discussion
Looking for a shortcut to display some predefined text
Vahid Damanafshan:
--- Quote from: MrPhil on June 27, 2012, 04:20:51 PM ---OK, Subs.php is not a good place for any text which is not pure ASCII. It would also limit your [rules] to one language. Perhaps you could try doing something with 'content' => $txt['rules'], and $txt['rules'] defined in one of the language files. It appears that Themes/default/languages/index.<language>.php (where <language> is something like english is available to Sources/Subs.php. The $txt['rules'] entry could be <ol> through </ol> (including the HTML list tags). You might play around with that.
--- End quote ---
--- Code: ---array(
'tag' => 'rules',
'type' => 'closed',
'content' => '<ol>$txt['rules']</ol>',
'block_level' => true,
),
--- End code ---
Thanks again for your reply, but when I use the code above, I get the following error:
--- Code: ---Parse error: syntax error, unexpected T_STRING, expecting ')'
--- End code ---
Arantor:
That's not valid code, hence the error, try this instead:
--- Code: ---'content' => '<ol>' . $txt['rules'] . '</ol>',
--- End code ---
Vahid Damanafshan:
--- Quote from: Arantor on June 27, 2012, 06:41:29 PM ---That's not valid code, hence the error, try this instead:
--- Code: ---'content' => '<ol>' . $txt['rules'] . '</ol>',
--- End code ---
--- End quote ---
It works, but I have another problem with it:
As you see in the attached picture, the contents of the tag is indented. How can I solve this issue?
Arantor:
Either don't use a list (which is what that is) or change the CSS for that list... lists are always indented as standard in HTML.
Vahid Damanafshan:
--- Quote from: Arantor on June 28, 2012, 05:25:35 AM --- lists are always indented as standard in HTML.
--- End quote ---
You are right, but as you see in the attached picture, if I don't even use a list, the text is still indented.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version