[SOLVED] UserEdit doesnt choose right template.css

12 years 7 months ago - 12 years 7 months ago #175543 by pretty381
Hi.
I got the problem, that when changing the template (using your template-changer in profiles) the "profile-view"-page will be including the right template.css but when editing profiles it will always include the "default/template.css".

Adding this line:
global $ueConfig; echo $ueConfig['templatedir'];

to this function:
function outputCbTemplate( $obsoleteUi = 0, $templateFile = 'template.css', $media = null ) {

in /administrator/components/com_comprofiler/comprofiler.class.php

will result in "dark" on "profile-view"-page and in "default" on "profile-edit"-page
analogue
$_CB_framework->document->addHeadStyleSheet( selectTemplate() . $templateFile, false, $media );

outputs this on profile-edit (wrong):
<link rel="stylesheet" href="[sitename]/components/com_comprofiler/plugin/templates/default/template.css" type="text/css" />

and this on profile-view (correct):
<link rel="stylesheet" href="[sitename]/components/com_comprofiler/plugin/templates/dark/template.css" type="text/css" />

hows that possible and what can i do trying to fix this?

greets

Please Log in to join the conversation.

12 years 7 months ago - 12 years 7 months ago #175568 by krileon
Replied by krileon on topic Re: UserEdit doesnt choose right template.css
This would be a bug with CB Template Changer if it's not loading the correct CSS file in profile edit. I've made a note to investigate and resolve if issue found with next release, sorry for the inconvenience. I also can not provide any sort of release date, sorry.

EDIT: reviewed source and the template is only changed on profile and not profile edit. You can fix this with the below quick fix.

IN: components/com_comprofiler/plugin/user/plug_cbtemplatechanger/plugin.cbtemplatechanger.php
ON: Line 7
FROM
$_PLUGINS->registerFunction( 'onBeforeUserProfileDisplay', 'getCBTemplate', 'cbtemplatechangerPlugin' );
TO
$_PLUGINS->registerFunction( 'onBeforeUserProfileEditDisplay', 'getCBTemplate', 'cbtemplatechangerPlugin' );
$_PLUGINS->registerFunction( 'onBeforeUserProfileDisplay', 'getCBTemplate', 'cbtemplatechangerPlugin' );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: pretty381

Please Log in to join the conversation.

12 years 7 months ago #175589 by pretty381
Replied by pretty381 on topic Re: UserEdit doesnt choose right template.css
Thank you very much! It looks much better now :-)

You should include this in the next release of templatechanger-plugin :-)

Please Log in to join the conversation.

12 years 7 months ago #175608 by krileon
Replied by krileon on topic Re: UserEdit doesnt choose right template.css
It'll be included with next release. Have already made change to the source, but I can't guarantee when next release will be and thus provided quick fix for those in need. ;)


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 7 months ago - 12 years 7 months ago #175811 by pretty381
Replied by pretty381 on topic Re: UserEdit doesnt choose right template.css
Just noticed, it will change on profiles of different users to THEIR chosen template and not mine. How to change this?

Looks pretty augward because i got a dark and a light template ...

thanks in advance :-)

Edit: Not the site-template, only their CB-Template ..

Please Log in to join the conversation.

12 years 7 months ago #175972 by krileon
Replied by krileon on topic Re: UserEdit doesnt choose right template.css
That's exactly what it's supposed to do. It's to allow the user to change what their profile looks like. If you want to limit what templates they can pick you need to disable them from plugin management (do not disable the default template!).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.241 seconds

Facebook Twitter LinkedIn