Re: Feature idea: Page class attribute

2016-11-18 Thread Daniele Procida
On Thu, Nov 17, 2016, Brian Rutledge  wrote:

>In our templates, I'd like to be able to identify a page as being part of a 
>section of the site, so that we can apply section-specific CSS. My initial 
>thought on how to do this would be to add a class to the  tag, but I 
>don't see an attribute on the Page model for this. What do y'all think of 
>adding that? Is there another way to accomplish this in the django CMS 
>ecosystem? I'd rather not define a new template for each section.

I've done this with another application. It maintained a tree representing the 
structure of an institution, and each node of that tree could be attached to a 
page. So each page, and all of its descendants, knew they belonged to 
such-and-such department or office or body.

The application did a lot more besides. It might be overkill if identifying a 
page is all you need.

Daniele

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
django-cms-developers+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-cms-developers+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/20161118091047.1469017626%40mail.wservices.ch.
For more options, visit https://groups.google.com/d/optout.


Re: Changing plugin settings results in missing migrations

2016-11-18 Thread Angelo Dini
I'll be porting the fix to the other core addons, will try to release them 
around early next week.

On Wednesday, 16 November 2016 20:20:12 UTC+1, Brian Rutledge wrote:
>
> I posted this issue to djangocms-style 
> , but it seems to me 
> that it affects multiple plugins, so I'm re-posting the description here.
>
> I just upgraded to 2.0.0, and discovered that setting 
> DJANGOCMS_STYLE_CHOICES and DJANGOCMS_STYLE_TEMPLATES results in changing 
> the choices for class_name 
> 
>  
> and template 
> ,
>  
> which necessitates new migrations. It looks any djangocms plugin that uses 
> this pattern (-link, -picture, etc.) will display this behavior. I am not 
> an expert on migrations, so it's not clear to me what problems it might 
> cause, but it make me nervous about future conflicts, and having migrations 
> outside of source control.
>

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
django-cms-developers+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-cms-developers+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/b2c1cd1b-407a-457e-b8b2-8bd5f74f93fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Feature idea: Page class attribute

2016-11-18 Thread Brian Rutledge
Thanks for the ideas. I think djangocms-page-tags or a page extension is 
the right approach, but for now, I've got:



which renders the attribute value as "section-1/subsection-1/page-1". So, 
in my CSS, I can use:

[data-cms-path*="subsection-1"] {
}

to style section elements. Of course, this will break of the slugs change, 
or if they're different in Spanish, or if a section page exists outside of 
the tree. But it works for now.

 


 

On Friday, November 18, 2016 at 4:10:51 AM UTC-5, Daniele Procida wrote:
>
> On Thu, Nov 17, 2016, Brian Rutledge > 
> wrote: 
>
> >In our templates, I'd like to be able to identify a page as being part of 
> a 
> >section of the site, so that we can apply section-specific CSS. My 
> initial 
> >thought on how to do this would be to add a class to the  tag, but 
> I 
> >don't see an attribute on the Page model for this. What do y'all think of 
> >adding that? Is there another way to accomplish this in the django CMS 
> >ecosystem? I'd rather not define a new template for each section. 
>
> I've done this with another application. It maintained a tree representing 
> the structure of an institution, and each node of that tree could be 
> attached to a page. So each page, and all of its descendants, knew they 
> belonged to such-and-such department or office or body. 
>
> The application did a lot more besides. It might be overkill if 
> identifying a page is all you need. 
>
> Daniele 
>
>

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
django-cms-developers+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-cms-developers+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/701835d0-886d-4a18-b465-fe85fc25f73f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.