Keyword

Blank spaces causes problem in CSS

  • Mats Arvendal
  • Mats Arvendal's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 6 months ago #79480 by Mats Arvendal
Blank spaces causes problem in CSS was created by Mats Arvendal
Hi,

In K2 v2.2 there are some mysterious blank spaces that prevent me from using class suffix for different styles on different pages. I tracked down one of them in templates\default\category.php: line 16 says

echo ' '.$this->params->get('pageclass_sfx'); ?>


but it should say:

echo ''.$this->params->get('pageclass_sfx'); ?>


This error creates the class itemListView _someSuffix instead of itemListView_someSuffix.

Similar occurs for the classes groupLeading and itemView in the K2 CSS. But these I cannot figure out where they are generated.

 

Is this a bug or what?

 

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #79481 by Mark Banks
Replied by Mark Banks on topic Blank spaces causes problem in CSS
If this is confirmed as a bug within the code, the following files also display the same problem.
The 'bug' is a space between the apostrophe following echo ' '

File: category.php
Location: DOMAIN\com_k2\templates\default\category.php
Line: 16
Says: echo ' '.$this->params->get('pageclass_sfx'); ?>
should say: echo ''.$this->params->get('pageclass_sfx'); ?>

File: item.php
Location: DOMAIN\com_k2\templates\default\item.php
Line: 18
Says: if($this->item->params->get('pageclass_sfx')) echo ' '.$this->
should say: if($this->item->params->get('pageclass_sfx')) echo ''.$this->

File: category_item.php
Location: DOMAIN\com_k2\templates\default\category_item.php
Line: 19
Says: if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item
should say: if($this->item->params->get('pageclass_sfx')) echo ''.$this->item

File: category_item_links.php
Location: DOMAIN\com_k2\templates\default\category_item_links.php
Line: 19
Says: if($this->item->params->get('pageclass_sfx')) echo ' '.$this->
should say: if($this->item->params->get('pageclass_sfx')) echo ''.$this->

File: latest.php
Location: DOMAIN\com_k2\templates\default\latest.php
Line: 16
Says: if($this->params->get('pageclass_sfx')) echo ' '.$this->
should say: if($this->params->get('pageclass_sfx')) echo ''.$this->

File: generic.php
Location: DOMAIN\com_k2\templates\generic.php
Line: 16
Says: if($this->params->get('pageclass_sfx')) echo ' '.$this->
should say: if($this->params->get('pageclass_sfx')) echo ''.$this->

File: user.php
Location: DOMAIN\com_k2\templates\user.php
Line: 16
Says: if($this->params->get('pageclass_sfx')) echo ' '.$this->
should say: if($this->params->get('pageclass_sfx')) echo ''.$this->

Maybe Tweet the devs to have a look.

Please Log in or Create an account to join the conversation.

  • Mats Arvendal
  • Mats Arvendal's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 6 months ago #79482 by Mats Arvendal
Replied by Mats Arvendal on topic Blank spaces causes problem in CSS
I am not a PHP programmer so I am really unsure. I dont have any account on twitter, but I don't know if thats necessary?

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #79483 by Mark Banks
Replied by Mark Banks on topic Blank spaces causes problem in CSS
Lefteris, just bumping this.
are the spaces between the ' ' symbols intended to be in the code or not?

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #79484 by Lefteris
Replied by Lefteris on topic Blank spaces causes problem in CSS
Hi. I m not the one who built the template files but i think that the space is intended to be there. So the logic is that you can add an extra class and not a suffix. Of course you can change this on your own template files.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Mats Arvendal
  • Mats Arvendal's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 6 months ago #79485 by Mats Arvendal
Replied by Mats Arvendal on topic Blank spaces causes problem in CSS
The problem is that when I put a class sufix like _someSuffix it will result in itemListView(space)_someSuffix, thus preventing the tag from using the css of itemListView(nospace)_someSuffix. As you say, it creates an extra class, but usually the Joomla class suffixes are combined. So there's a nota bene not to think of this as one usually does with Joomla suffixes. Or?

Rgds
--Mats

Lefteris Kavadas said:Hi. I m not the one who built the template files but i think that the space is intended to be there. So the logic is that you can add an extra class and not a suffix. Of course you can change this on your own template files.

Please Log in or Create an account to join the conversation.

More
14 years 3 weeks ago #79486 by theandygram
Replied by theandygram on topic Blank spaces causes problem in CSS
Did this ever get clarified? I am having the exact same problem on this page:

theandygram.com/About-Andy/press.html

This appears to be putting a space in front of the _headlines suffix I have for k2ItemsBlock.

Does anyone have any suggestions as to how to modify the look of this module using the suffix?

Thanks
Andy

Please Log in or Create an account to join the conversation.

  • Mats Arvendal
  • Mats Arvendal's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 3 weeks ago #79487 by Mats Arvendal
Replied by Mats Arvendal on topic Blank spaces causes problem in CSS
Sometimes it's somewhat hard to find (get) really clearifying answers in K2 matters. I suppose it's the nature of Open Source communities - many possibilities, many questions and sometimes you need a bit of luck to find the person who knows the particular question you are dealing with. This question is such and I have drawn the conclusion that the blank space is intended because that gives you the possiblity to assign several classes to a specific HTML tag, for example class="frontpage leftcolumn news". What's confusing is that the core Joomla module class suffix adds to the class="moduletable" attribute, for example class="moduletable_frontpage". This results, for example, in code looking like this:
< div class="moduletable_frontpage" >
< h3 >Header< /h3 >
< div id="k2ModuleBox32" class="k2ItemsBlock _frontpage" >

It's the behaviour that needs to be understood. I think it provides more possibilities to the styling, BUT it took me a while to get the hang of it.
Rgds

Please Log in or Create an account to join the conversation.

More
14 years 3 weeks ago #79488 by theandygram
Replied by theandygram on topic Blank spaces causes problem in CSS
Hi Mats,

Thanks for your reply. I feel like the answer may be in your response but it's not clear to me how we apply a style to this. Would you mind clarifying or restating?

Many thanks,
Andy

Please Log in or Create an account to join the conversation.

More
14 years 3 weeks ago #79489 by theandygram
Replied by theandygram on topic Blank spaces causes problem in CSS
OK Mats, I am very happy to report that I have figured it out. When you define the style you just need to do it by assigning two styles to it as follows:

div.k2ItemsBlock.Headlines ul li a.moduleItemTitle:hover {font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;font-size:12px; line-height:135%}

Thanks so much Mats for your helpful hint.

Andy

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum