Where to begin... (General)

by Cleo, Saturday, January 28, 2023, 21:33 (477 days ago)

Ok, I have MLF installed - I like the format a lot. I installed another theme I like as well. However...

I have no idea how to edit a site such as this, aside from the CSS. I understand the particular format relates to a template engine called Smarty - I am not experienced with, or familiar with this. I know how to edit HTML well, and PHP decently - I don't know how to even approach editing this code, though!

To use a hard example, say

I wanted to change something simple like change 'New topic' to 'Post topic' or wanted to change # of allowable characters in a form field. Where to even look? How to approach? Can the HTML be edited?

Any direction or guidance much appreciated, thank you!

Avatar

Where to begin...

by Micha ⌂, Sunday, January 29, 2023, 10:47 (476 days ago) @ Cleo

Hello,

I have no idea how to edit a site such as this, aside from the CSS.

Please note, the template uses the compressed version of the CSS file.

I understand the particular format relates to a template engine called Smarty - I am not experienced with, or familiar with this. I know how to edit HTML well

If you are familiar with HTML, it is quite easy. Just open one of the template files e.g. the main.tpl. It is a HTML file with some specific Smarty code. For instance, the second line reads:

<html lang="{#language#}" dir="{#dir#}">

This line will be compiled to, for instance,

<html lang="de" dir="ltr">

The variables #language# and #dir# depend on your forum settings and relates to Smarty variables.

I wanted to change something simple like change 'New topic' to 'Post topic'

This is not a HTML or template issue. If you like to modify the labels, please take a look to the lang folder and edit the corresponding file.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Where to begin...

by Cleo, Sunday, January 29, 2023, 18:38 (476 days ago) @ Micha

Thank you, this is very helpful!

Avatar

Where to begin...

by Auge ⌂, Sunday, January 29, 2023, 17:20 (476 days ago) @ Cleo

Hello …

Ok, I have MLF installed - I like the format a lot. I installed another theme I like as well. However...

… and welcome.

I have no idea how to edit a site such as this, aside from the CSS. I understand the particular format relates to a template engine called Smarty - I am not experienced with, or familiar with this. I know how to edit HTML well, and PHP decently - I don't know how to even approach editing this code, though!

The project utilises Smarty, which is a template engine, that mixes HTML with a basic PHP-based programming language, that makes it possible to replace placeholders with content of variables and to loop over a collection of similar things to generate table rows or lists items.

Mostly it is possible to change snippets of HTML and/or CSS. But you have to be patient because the main structure and variable names are fixed to fulfill their purpose. If you have questions about specific code, feel free to ask.

To use a hard example, say

I wanted to change something simple like change 'New topic' to 'Post topic' …

As Micha already said, is this a topic of the language file. Keep in mind, if you change a wording in a language file of your installation, the change will be lost with the next upgrade if it is not transferred to the new files of the upgrade package. Similar counts for changes in template files. If you change files in the default theme, your changes will be overwritten in case of an upgrade. If you maintain your own theme – what is the recommended way –, you need to track functional changes from the default theme in case of an update.

Functional changes can be the introduction of form fields because of a security issue (we did this with the introduction of hidden fields with a csrf-token in many forms to prevent the inserting of unwanted content from external sources) or in general new fields for new purposes.

… or wanted to change # of allowable characters in a form field.

To change the number of characters for several fields is possible in the forum settings. This belongs in example to the user name, subject, e-mail-address and a few others. See therefore the configuration items description in the project wiki.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Where to begin...

by Cleo, Sunday, January 29, 2023, 18:37 (476 days ago) @ Auge

Thank you very much for the responses, Micha & Auge - I will take some time to read over & digest your replies and post back if I have more questions. I appreciate the time you put into writing them, thank you!

Where to begin...

by Cleo, Friday, February 03, 2023, 22:53 (471 days ago) @ Auge

Could you tell me where/how to change something such as the size of the input field on the 'New topic'/create post page?

Not the # of characters allowed, but the actual size of the box - such as making the 'Subject' input box closer to the size of the 'Message' box. Thank you!

Avatar

Where to begin...

by Auge ⌂, Saturday, February 04, 2023, 11:09 (470 days ago) @ Cleo

Hello

Could you tell me where/how to change something such as the size of the input field on the 'New topic'/create post page?

This is a task for the HTML sources. You can change the size of the input fields in the respective templates. For the posting form this is templates/[theme-name]/subtemplates/posting.inc.tpl, beginning with line 54 (in version 20220803.1). Please do not remove or rename any of the input fields, even you don't see them in the browser. What you can change without causing any issues are the values of the attributes named size.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

RSS Feed of thread