When looking at a typical view in Django, there's usually an icon in the margin beside the template filename passed to render. You can also click on the string and hit "Ctrl+B" to jump to the template.
I have my own methods that I pass a string defining which template to use and it'd be nice if I could have PyCharm recognize that and allow me to quickly jump to the file. Is there a way to get PyCharm to recognize that method argument as being a template filename?
Make sure that Django is enabled in your project,
Also, you can right-click folder containing the templates, and selected ‘Mark-as’ which in the last 5 as far as I remember and select ‘Template Folder’
Related
I am using Umbraco 7.5.8. I would like for a page to switch to another template if the browser being used is certain versions of internet explorer. I wasn't sure how to do this or if it could be done.
It seems that adding the altTemplate parameter to the URL, e.g:
my-domain.com/my-page?altTemplate=newTemplateName
works right out of the box (just make sure to add the new template to the document type's "Allowed Templates" in Umbraco). Combined with Mario's suggestion to use JavaScript, this should do it.
I am having serious problems customizing my views template to displayblog entries in drupal 7.
please anyone with knowledge of what can help me please reply. i have gone through a couple of drupal documentations but no luck. my field.tpl.php seem to be the only template that actually affect my displays even though i have views-view-field.tpl.php, views-view--blog.tpl.php in the template .
In the view settings, under format, show, make sure you have fields selected, not content.
Under advanced, theme, click information to see which template files are being used, and click rescan if necessary.
If you have created or edited a view, please check under FORMAT section this should be Show:Fields and under Advanced section look for Theme:Information and click onto this, there will be a popup with all possible templates for the display plugin and for the style plugins. All field tpl will be available here those are exists in views fields, you can find your own and use as per your requirement.
When you edit your view open "Advanced" section on the right (collapsed by default) and click on "Information" from "Theme: Information" (last option in that section). There you can see what templates are used (bolded ones) and what could be used instead. You can even click on template description at the beginning of the line, and code will be displayed. Grab that code (copy) and create new template file with one of offered names. Place that template file in your theme and clear the cache. Now you can modify template by your needs.
Also, you even don't have to use all that hierarchy (even that's desirable), but you can i.e. find the template file that are looping over the rows and inside that loop put your html, so lower rank templates won't be included (i.e. template that iterates over fields or even over rows) . Again not so clear solution, but it works for me. I prefer having less template files and I know that nobody will work on that theme except me.
I have rendering items and I can open its property dialog pop-up by using below javascript.
Sitecore.PageModes.PageEditor.postRequest("webedit:fieldeditor(command={11111111-1111-1111-1111-111111111111}, fields=field1|field2|field3, id={155DA3B8-41D9-4DA3-9D87-CBA72F67A0E2})");
However, I had to add Parameter Template for one rendering item. So, I created parameter template (Custom Styles) like this screenshot, but below javascript is not working.
Sitecore.PageModes.PageEditor.postRequest("webedit:fieldeditor(command={11111111-1111-1111-1111-111111111111}, fields=CSS1|CSS2|CSS3|CSS4|CSS5, id={F7D900EF-9D68-4488-855D-B96FBF6D9F27})");
I guess these fields are from parameter and I might have to use another command to call this pop-up, right? any idea, please?
This is what I found and there is webedit:editrenderingproperties command, but I don't know how I can use this command.
Sitecore.PageModes.PageEditor.postRequest("webedit:editrenderingproperties(.......)");
http://www.sitecore.net/learn/blogs/technical-blogs/getting-to-know-sitecore/posts/2013/11/updated-field-editor-for-rendering-properties.aspx
Try webedit:ext:renderingfieldeditor instead (of course, if I understood your problem right).
There is an article that describes exactly what you are looking for:
Field Editor for Rendering Properties
I'm using Grappelli with Django. When I follow the procedure as outlined in the Django docs to override a specific template for a specific model, it appears that Django (or Grappelli??) are struggling to render the template correctly.
I have copied the change_form.html file to the templates directory with the following subpath:
admin/properties/Calendar
where properties is the name of the app and Calendar is the name of the model for which I want to override the change form. Now the following appears
At least two things are not rendered correctly:
The breadcrumb bar is much thinner and the crumbs are tightly aligned with the left border of the bar.
The link for the history of changes is in the wrong place (it appears on the left), has the wrong style (no rounded edges) and appears twice.
I double checked that the correct template file is used by Django, so the mechanism as documented works albeit with the above described flaws. When I rename the duplicated template file or delete it from my app, everything looks fine again.
Before I dive into this, I was hoping someone could hint at what is going wrong here. All not overridden templates seem to work just fine.
From what I read I suspect you copy the default admin change_form.html template and not the grapelli version, found at grappelli/templates/admin/change_form.html.
If you want to override a grapelli template, then you should use that as source!
In joomla, I need to assign specially designed templates for both "User Edit" (Where user edits their details)
/index.php?option=com_user&view=user&task=edit
and "Search Results"
I can't for the life of me work out how Joomla is selecting templates now. Certainly ItemID's aren't obvious and template overrides aren't giving any clues.
Currently Search is defaulting to the site 'home page' template, and the user edit to the 'default' template.
I don't think it should matter but we are using jfusion.
Can anyone point me in the write direction
Thanks
Stephen
Templates in Joomla are assigned to different pages (via menu items) under Extensions > Template manager. The default template (with a star) is assigned to all otherwise unassigned pages. For the other templates, click the name and choose the pagesto assign it to.
If you don't have menu items assigned to the pages you mentioned, you can create a new menu called "hidden menu", make the menu items there, then link to those menus.
I think you're getting terminology mixed up though. "Template overrides" are files that reside in each template that override the default content output. There's only one set per template - if you want multiple template overrides you need multiple templates.
template over rides are stored in the templates folder.
so if you are using teh template called "beez" (comes stock standard)
the template overides are in :
templates/beez/html/
they are then stored under the module or component name. eg the article layout for com_content is stored in:
templates/beez/html/com_content/article/default.php
the template is usualy called default.php, but each component and module can have a few extra templates that they use as well as deafult.php
Now you are asking to change the "user" view for com_user when editing
I think that location is:
templates/beez/html/com_user/user/form.php
if you ever want to find the origanal template which is to be overridden in this case: template that would be in:
/components/com_user/views/user/tmpl/form.php
so in general
templates/templatename/component_name/view_name/template_filename.php
Lets try ::
/index.php?option=com_user&view=user&task=edit&template=template-name
parameter template comes from /includes/application.php:311
// Allows for overriding the active
template from the request
$template = JRequest::getCmd('template',
$template);
Hope it will work :-)