Templating of CB

12 years 4 months ago #185715 by awenger_k
Templating of CB was created by awenger_k
At first I want to complement complement the Community Builder crew for this wonderful Joomla component. It makes my life a little easier.

However, I've some questions regarding template plugins for CB.
Right now I'm adjusting the template of CB to fit with my general Joomla Template. Using the default template as a basis for my new template, I managed to adjust quite a lot. However, during my 'journey' of adjusting the template, I still don't find a way to adjust the page-navigation in user-list views using my own template.

Of course I dug a little deeper and found the "writePagesLinks" function in the main class of the CB-component. Now, I could adjust the output of this function in such a way that is suits my needs to something like this:
From:
if ($i == $this_page) {
			$ret .= "\n <span class=\"pagenav\">[".$i."]</span> ";
		} else {
			$ret .= "\n<a class=\"pagenav\" href=\"".cbSef($ue_base_url.$limstart_str.$page.$search_str)."\"><strong>$i</strong></a>";
		}
To this:
if ($i == $this_page) {
			$ret .= "\n".'<span class="pagenav pncurrent pnnumber">'.$i.'</span>';
		} else {
			$ret .= "\n".'<a class="pagenav pnnumber" href="'.cbSef($ue_base_url.$limstart_str.$page.$search_str).'">'.$i.'</a>';
		}
The change is minimal, but this way I can adjust my pagination using CSS instead of the local html in the code.

Of course I can change this in the source of CB, but... this would also mean that when I update my CB version in the future, my changes will be lost and I will have to re-do them again.

Can I somehow overrule this function like you can do for some classes? Or do I have to write my own function for the creation of the pagination for my template?

By the way, it is a general remark from me to the CB team: there is a lot of hard-coded html in the source to build up the page and not as much CSS identifiers to make "templating" a little more easy. And with this I mean the code that builds for example the pagination, but also changing the default avatar location is not that easily done. Or I am overlooking something. In that case I could use some hints ;-)

Thanks in advance.


Ps. If I can contribute to CB in anyway like solving tags like this: //TODO: Rewrite this module completely!, then I would do gladly do so ;-)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.143 seconds