Bootstrap 4 Templates

204 views
Skip to first unread message

Fendy Pierre

unread,
Apr 14, 2019, 8:11:57 PM4/14/19
to django-oscar
I already have  bootstrap 4 templates that I want to use for the front end. What's the best approach for migrating the templates ? 

priyank soni

unread,
Apr 15, 2019, 1:09:58 AM4/15/19
to django...@googlegroups.com
Hi Fendy, 

You need to copy templates folder of Oscar into your project folder and add it's path like this:: 


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            #os.path.join(BASE_DIR,'yourappsfolder/catalogue/templates'),
            location('templates'), # templates directory of the project #added
            #os.path.join(BASE_DIR, 'templates'),
            #OSCAR_MAIN_TEMPLATE_DIR,
            #os.path.join(BASE_DIR, 'yourappsfolder/kitchen/templates'),
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.i18n',
                'django.contrib.messages.context_processors.messages',

                'oscar.apps.search.context_processors.search_form',
                'oscar.apps.promotions.context_processors.promotions',
                'oscar.apps.checkout.context_processors.checkout',
                'oscar.apps.customer.notifications.context_processors.notifications',
                'oscar.core.context_processors.metadata',
            ],
        },
    },
]


Now you can modify these templates as per your need. 

Regards, 
Priyank



On Mon 15 Apr, 2019, 5:42 AM Fendy Pierre, <fendy...@gmail.com> wrote:
I already have  bootstrap 4 templates that I want to use for the front end. What's the best approach for migrating the templates ? 

--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/6977df1a-7050-4d20-a496-c51d6494a16c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fendy Pierre

unread,
Apr 15, 2019, 1:32:15 AM4/15/19
to django-oscar
Thank you for the reply. Using this method, will I need to extend the base.html from oscar? 

Fendy Pierre

unread,
Apr 15, 2019, 1:40:09 AM4/15/19
to django-oscar
Also, which module do I import location from?


On Sunday, April 14, 2019 at 7:11:57 PM UTC-5, Fendy Pierre wrote:

priyank soni

unread,
Apr 15, 2019, 1:41:15 AM4/15/19
to django...@googlegroups.com
The folder which you are copying will contain base.html, now you can modify this if you want, no need to extend anything. 

Regards,
Priyank Soni




Mailtrack Sender notified by
Mailtrack 15/04/19, 11:09:10

--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.

SammyJ

unread,
Apr 15, 2019, 1:50:44 AM4/15/19
to django-oscar
I don't think it is a good idea to modify base.html, because it would modify the /dashboard/ css since it also extends the base.html, unless that's what you want, I guess you can modify the layout.html in the same folder instead, this will change the designs for the user's side only.


On Monday, April 15, 2019 at 11:11:15 AM UTC+5:30, priyank wrote:
The folder which you are copying will contain base.html, now you can modify this if you want, no need to extend anything. 

Regards,
Priyank Soni




Mailtrack Sender notified by
Mailtrack 15/04/19, 11:09:10

On Mon, Apr 15, 2019 at 11:02 AM Fendy Pierre <fendy...@gmail.com> wrote:
Thank you for the reply. Using this method, will I need to extend the base.html from oscar? 

On Sunday, April 14, 2019 at 7:11:57 PM UTC-5, Fendy Pierre wrote:
I already have  bootstrap 4 templates that I want to use for the front end. What's the best approach for migrating the templates ? 

--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

Fendy Pierre

unread,
Apr 15, 2019, 1:55:42 AM4/15/19
to django-oscar
Okay is there an alternative approach where I can modify the base html without affecting the dashboard? 

priyank soni

unread,
Apr 15, 2019, 2:08:46 AM4/15/19
to django...@googlegroups.com
Let's take example of browse.html, its hierarchy is::

base.html--> layout.html--> layout_2_col.html-->  browse.html  

If you want to make changes in browse.html, you can modify(override tags) in parent files.
If you requirement is very specific you can write your own base.html (say it base1.html)

base1.html--> layout.html--> layout_2_col.html-->  browse.html

Regards,
Priyank Soni


Mailtrack Sender notified by
Mailtrack 15/04/19, 11:37:37

To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages