Skip to main content
Topic: Templating (Read 2016 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Templating

Good evening!

I just had a peek at ElkArte, and was recommended to it by a friend over using phpBB. I have to say that I am impressed with the features that have come along in such a short time, however have a few curiosities if anyone would be willing to fill me in, I'd be ever grateful.

In my off-time, as both a hobby and contractor, I'm a web developer that focuses heavily on PHP 5.6, SCSS, and HTML5. I have a strong affinity with the Foundation platform as well. Naturally, keeping up with up-to-date technologies and having works that are easy to maintain/update are of interest to me. What type of work would I be looking at for the following:

  • Creating a theme, using a new templating engine such as Twig?
  • Developing an addon that would permit easy "switching" (logging in and out) via A.) Master accounts that have "authorized" accounts B.) "Sub-accounts". 
  • Custom BBCodes

An example of the second question would be this. Consider an journalism community that has a group of volunteers maintaining it. There is one primary "staff" account in addition to their own, for maintaining anonymity when offering constructive critique in articles submitted by users on the forum as posts. Every volunteer staff member would need access to said account, but rather than sharing credentials they can simply have it 'linked' to their own, and switch between the two.

Alternatively, the option of creating "sub accounts" or "aliases" under their own may work, though I would prefer the former option.

Writing my own functions is of no foreign nature to me, and I'm more than comfortable diving in. However, as this is a new platform with its own coding guidelines, API and specifications (I believe a new version is due sometime around the holidays as well, if memory serves from what I read), I'd prefer to get insider knowledge from someone who might know the fine details.

Any information or assistance would be greatly appreciated.

Sincere thanks for your dedication, and hard work! I look forward to hearing from everyone.

Best,
Gallant
Last Edit: December 13, 2015, 03:01:24 am by gallant

Re: Templating

Reply #1

1. I don't know about twig but I simply copy and modify default theme to create my own.
2. Have you check on the addon board / page for that?
3. I have created few addons on bbc. It's not so tough.
Last Edit: December 13, 2015, 08:37:49 am by ahrasis

Re: Templating

Reply #2

Swapping out the current template system for Twig would be a huge undertaking. The current system uses native PHP. It's not hard to understand, but it is less "nice" than Twig.

I know there is a plugin for SMF to do sub accounts. Not sure about Elkarte. Since Elkarte is a fork of SMF, it might not be hard to port it over.

Custom BBC is pretty easy. There should be a topic around on how to do that.

Re: Templating

Reply #3

Hi!
And welcome! :)

Quote from: gallant – In my off-time, as both a hobby and contractor, I'm a web developer that focuses heavily on PHP 5.6, SCSS, and HTML5. I have a strong affinity with the Foundation platform as well.
Interesting!
Foundation is one of the frameworks I played around with to experiment, though I've never been able to understand it enough to use it properly... :(

Quote from: gallant –
  • Creating a theme, using a new templating engine such as Twig?
That would be utterly cool!
I have the intention to experiment in that direction as well, though I have no idea when I'll find time to understand Twig and what it needs to be used in Elk.
If I got it right, $context could give most of what Twig needs, though it may not be in the best shape for the engine.

Quote from: gallant –
  • Developing an addon that would permit easy "switching" (logging in and out) via A.) Master accounts that have "authorized" accounts B.) "Sub-accounts". 
Posting from an alias is quite a lot "easier" than have a sub-accounts system I think.
It actually depends on the complete specifications, but at the end of the day, post using a "common" alias, it would be as easy as use integrate_before_create_post to check whether the current user is allowed to use the alias and is so change the id_member to whatever your want (well, then after that you have to write the interface to configure the alias, but that's another story :P).

Should be rather easy to do. ;D

Quote from: gallant – Sincere thanks for your dedication, and hard work! I look forward to hearing from everyone.
Thanks to you for considering Elk! ;D
Bugs creator.
Features destroyer.
Template killer.

Re: Templating

Reply #4

You can get some ideas of how to add custom bbc codes by looking at these addons: http://addons.elkarte.net/categories/bbc.html  Best to look at those to understand how to interact with the editor in both plain and wizzy modes

I like the idea of the aliases quite a lot.  There is a swap permissions addon that could probably be extended to do what you are describing.