Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Columns doesn't work for me. #5

Open
anywhim opened this issue Aug 8, 2013 · 8 comments
Open

Columns doesn't work for me. #5

anywhim opened this issue Aug 8, 2013 · 8 comments

Comments

@anywhim
Copy link

anywhim commented Aug 8, 2013

Today I install fresh django-cms 3 and djangocms-grid plugin. In placeholder I created MultiColumns(grid) plugin with two grid-12 column. In each column I created Text plugin. So text must be render in two same columns. But that don't happen.

Of course, I know I can to add some class to MultiColumns plugin(e.g. "row" as in bootstrap) and some class in each GridColumn(e.g. "span6"), but I think this plugin should work another.

@alesdotio
Copy link
Contributor

This plugin uses the 960 grid by default. You can easily override the templates to support the bootstrap grid for example.

@anywhim
Copy link
Author

anywhim commented Aug 9, 2013

Probably I will do that. But I wanted tell this plugin don't get settings such as COLUMNS,TOTAL_WIDTH,GUTTER from my settings.py out of the box.

@alesdotio
Copy link
Contributor

If you want to use your own settings, you have to add

DJANGOCMS_GRID_CONFIG = {
    'COLUMNS': 24, 
    'TOTAL_WIDTH': 960, 
    'GUTTER': 20
}

to your settings.py

see https://github.com/divio/djangocms-grid/blob/master/djangocms_grid/models.py#L9

@anywhim
Copy link
Author

anywhim commented Aug 9, 2013

Yes, but unfortunately that doesn't work for me. (

@anywhim
Copy link
Author

anywhim commented Aug 9, 2013

I noticed plugin get settings from my settings.py because when I create new MultiColumn(grid) I have choise of sizes column according my settings. Probably doesn't work this string: 'width': GRID_CONFIG['TOTAL_WIDTH'] / GRID_CONFIG['COLUMNS'] * int(instance.size) - GRID_CONFIG['GUTTER'] in https://github.com/divio/djangocms-grid/blob/master/djangocms_grid/cms_plugins.py

@alesdotio
Copy link
Contributor

what are your settings?

@anywhim
Copy link
Author

anywhim commented Aug 9, 2013

DJANGOCMS_GRID_CONFIG = {
'COLUMNS': 12,
'TOTAL_WIDTH': 940,
'GUTTER': 20,
}

@anywhim
Copy link
Author

anywhim commented Aug 9, 2013

I add style="width: {{ width }}px;" into template and that correct work for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants