pepperstreet VIP
Total posts: 3,837
05 Июль 2015 00:37

Hello gteigland,

actually the Cobalt user's homepage is the section view, with an additional URL context. In other words, it is basically controlled by the usual suspects. See YourSection -> General Parameters tab -> Templates :

Section markup layout (includes options for section menu, personalization, etc.)
default_markup_default.php

Depending on your section settings and markup template params,
the markup template also loads a special user block area and the according template:
default_user_block.php

Files can be found here:

/components/com_cobalt/views/records/tmpl


gteigland VIP
Total posts: 159
21 Июль 2015 04:22

So I have another question related to this that IM REALLY HOPING i can find a solution to.

  1. I purchased the cobalt add on pack for Portfolio by joomboost.
  2. So that creates another section and content type which is fine that works for me
  3. However as you know I've been editing the default_user_block.php (putting it in my joomla template) for my other Project Section
  4. But of course that means it looks the same (minus some css stuff I did) as my other project section

What Im trying to achieve is a completely different look for my portfolio home. So can I either:

  1. Create seperate template for default_user_block.php
  2. In the least is their a distinct class or id that i can add for section that differents between the two sections so then I can do a group of css {display:none}

I realize I can edit the default_markup_default to a different template BUT in this case I need to remove some things from default_user_block.php that only affects my portfolio section.

THANKS!


pepperstreet VIP
Total posts: 3,837
21 Июль 2015 15:12

gteigland 3. However as you know I've been editing the default_user_block.php (putting it in my joomla template) for my other Project Section 4. But of course that means it looks the same (minus some css stuff I did) as my other project section

An obvious shortcoming (or feature) of a J! HTML override. It will effect all occurencies.

  1. Create seperate template for default_user_block.php
  2. In the least is their a distinct class or id that i can add for section that differents between the two sections so then I can do a group of css {display:none}

I realize I can edit the default_markup_default to a different template BUT in this case I need to remove some things from default_user_block.php that only affects my portfolio section.

You have different options:

A.) Make the override more dynamic.
For instance, detect the page context you are in and output certain CSS classnames,
Or even create conditional PHP IF areas.

B.) Don't use a general override, because Joomboost's Markup template might use the default as well.
Load your own user_block template. Just make a copy in the original location.
Give it a new name e.g. default_mynewuser_block. Use that name to load your file in your custom MarkUp layout template! See around line# 39. Find and change this command loadTemplate('user_block')
Make sure to ommit the prefixed default_ portion ;)
Should look like this: loadTemplate('mynewuser_block.php')

C.) You might also make the loading more dynamic. Maybe use the current sectionID# and append it to the filename... then load this specific user-block-sec99.php file...

D.1) Checkout your Markup Layout template. There might be a surrounding DIV... if not, create one arround the Cobalt output. You might add the SecID# etc.

D.2) Checkout the J! template structure and available classes. Some Joomla templates include the page context and view as CSS classes in BODY/HTML tags. Apart from this, the MenuItems parameter "PageClassSuffix" can help to distinguish and style certain pages. You might utilize and output these infos inside your Cobalt templates.


BTW, the current SEC ID# can be retrieved easily. Please, see default list templates. The table gets a special CSS class based on the sectionID ;)


@Sergey I think I have already created a request in another topic about "default CSS classes" etc.
It would be really nice to have "contextual" CSS classes in the default templates. I am also missing a general surrounding DIV container with such class(es). Currently the areas are "separated". Hard to effect the whole page by CSS. (at least the user homepage context, regular sections have a workaround through J! PageClassSuffix)
Each template could have a custom class parameter. Which is applied to its outermost container element.
In general, maybe a nice idea to make templates markup compatible and universal?! So, I can easily adjust all basic layout CSS classes. Often CSS grids follow the same logic... just have different class names.


Sergey
Total posts: 13,748
22 Июль 2015 09:32

pepperstreet @Sergey I think I have already created a request in another topic about "default CSS classes" etc. ......

I am not sure that I am capable of duing that. I am not a pro at CSS or HTML markup encoding.


gteigland VIP
Total posts: 159
22 Июль 2015 12:43

You both are geniuses! Option B worked perfectly for me!


pepperstreet VIP
Total posts: 3,837
23 Июль 2015 02:26

Sergey I am not sure that I am capable of duing that. I am not a pro at CSS or HTML markup encoding.

Focus, Sergey! ;) I think you can do it, actually it is more a PHP job. BTW, you have already done some similar things on fieldID#'s and also the sectionID# on default table list.

I am not talking of fancy things, nor tricky CSS rules. Just make the previous examples a Cobalt standard. For all default templates. Apart from the important section and category ID# and a WRAPPER DIV around the markup layout...
I could imagine a complete set of URL parts and infos about the current page context.

Something similar is found in Protostar for the BODY tag.
Joomlart T3's Template Hook adds the infos to the HTML tag.
Yootheme WARP has a similar functionality, but uses it mainly for their own template struture and layout.


pepperstreet VIP
Total posts: 3,837
23 Июль 2015 02:31

gteigland You both are geniuses! Option B worked perfectly for me!

Glad we could help you out. Like your project and current results, too!


Sergey
Total posts: 13,748
23 Июль 2015 13:20

pepperstreet Focus, Sergey! ;) I think you can do it, actually it is more a PHP job. BTW, you have already done some similar things on fieldID#'s and also the sectionID# on default table list.

I could do it if I get correct instruction. But I do not know what would be correct markupso that it is easely ajastable by custom CSS and also work universal with any framework.


pepperstreet VIP
Total posts: 3,837
25 Июль 2015 00:11

Sergey I could do it if I get correct instruction. But I do not know what would be correct markupso that it is easely ajastable by custom CSS and also work universal with any framework.

I guess, a good advice is to use a prefix for common classnames. If it is obvious that classenames could be used by other extensions, simply add something like cob, cob-, mjc- etc.

In regards of the advanced idea for universal grids and frameworks: It should work with the ususal free input parameter in the template. If nothing is entered use a bootstrap default.

Работает на Cobalt