I made a plugin of a contact form that will be include in a page.
Actually, the page is call like this:
myurl/en/pageHeader/pageParent/contact/
As the cms is made of dynamic content, the url can change, depending of where the user wants to put the contact plugin or the page containing the plugin.
And here is my question, I want to pass a specific parameter to my url in order to fill a label of my form.
But, I don't figure out how pass this parameter, or in simpler words: I don't understand how to access the url where the plugin is.
So I have a basic architecture:
djangocms_plugin:
-migrations
-__init__.py
-admin.py
-api.py
-cms_plugins.py
-forms.py
-middleware.py
-models.py
-urls.py
-views.py
And in my url:
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from djangocms_partner.views import view_partner_contact
urlpatterns = patterns(
'',
url(r'^$', view_partner_contact, name='view_partner_contact'),
)
and the views.py:
# -*- coding: utf-8 -*-
import json
from django.http import HttpResponse
import logging
def view_partner_contact(request):
logging.info("\n\n COUCOU \n\n")
So as you can see, I simply try to figure out "how to access this".
Otherwise, I don't see how I could get the information providing for a previous page (directly link to this page, containing the plugins).
At the moment, this does nothing.
Thanks for the time spent on reading it.