Views, blocks and template? - drupal

I have a block view called: "MYVIEW"
And I have a region on my template called: "right".
What must I call the template file to edit this?
The following does not work.
block-MYVIEW.tpl.php
block-right--MYVIEW.tpl.php

When you are editing a view in Drupal's administration, you have something like "Thème: Informations" (my install is in french, so it might be a bit different for yours) in the section of the screen that correspond to "base parameters" (same remark) ; it's the section of the left of the screen, and that entry is near the bottom of the options you can configure.
If you click on the "informations" link, it will display a list of all names you can use for templates files related to that view ; you mimght way to try using one of those ;-)
The module Theme developper might also help you with that kind of stuff, btw.

Related

How to make footer to show items from main menu automatically in Plone?

I am using Plone 4.1.4 with Doormat and Diazo in an institute I work and the Footer has to be made manually by adding each column and item that links internally to items from main menu.
What I want is that this footer, which is the site map, to change automatically every-time some user create, edite or delete an item from the main menu (content folders).
When I got the job I noticed many of those links in footer are out of date, and as there are many users in their each sections of the institute that are allowed to change the structure, I know they won't update both folders and footer.
I searched the Internet for some product or tip but I cant' find anything that resolves that problem.
If your Diazo theme was created as a Python package using mr.bob or zopeskel, you probably already have z3c.jbot, which allows you to easily override templates, available. If so, you likely have a template_overrides or similar directory in the package. If so, just drop into it a file named plone.app.layout.viewlets.footer.pt with the contents:
<div i18n:domain="plone"
id="portal-footer">
<ul id="portal-doormat"
class="navTreeLevel0 visualNoMarker">
<tal:sitemap replace="structure context/##sitemap/createSiteMap" />
</ul>
</div>
Then style away!
Alternatively, you may replace the colophon by naming the file plone.app.layout.viewlets.colophon.pt.
If you aren't using a Python package for your theme (if the Diazo theme was created through-the-web) then you may use the portal_view_customizations tool in the ZMI to make the same template override.
You may wish to also customize the depth of the site map. That may be changed via the portal_properties tool, navtree_properties property sheet. Or, just use CSS to hide unwanted depth.
An alternative and much easier way to realize your demand, can be to use portlets instead of viewlets, in combination with the addons "Products.ContentWellPortlets" and "collective.portlet.sitemap":
1.) Hide the footer-viewlets via a GenericSetup-config like in this example:
http://svn.plone.org/svn/collective/adi.simplestructure/trunk/adi/simplestructure/profiles/default/viewlets.xml
2.) Assign a sitemap-portlet in the footer-area via a GenericSetup-config, similar to this example:
http://svn.plone.org/svn/collective/adi.simplestructure/trunk/adi/simplestructure/profiles/default/portlets.xml
Tip: First assign the sitemap-portlet via the Web-UI, then go to [SITE-URL]/portal_setup, search for "portlets", check its box and click the export-button on the bottom, to get the needed xml-file.

How to put pictures in a single row using semantic view?

I'm trying to put these pictures in a single row using semantic view in drupal7. I just created this view named try and put 2 pictures in it.
After that, I'm editing this view->format-format->setting->row (this is asking for class attribute, not mandatory) and I don't know what to write in this class attribute.
How do I put these pictures in a single row?
Make custom template for that view. Open "Advanced settings" on right side of view editing page and at bottom find "Theming information". There you can see template file suggestions. There if you can see the code of default templates (and copy it to clip board) but you can also see naming suggestions for overriding default templates. So copy code from default template, make from it file with some suggested name, save file in your theme...and clear the cache.
Then change the file as you wish, depending on your needs....
The CSS 'display:inline-block' is a good way to make rows. CSS Flexbox is more difficult to understand, but very powerful. Occasionally, the CSS 'float:left' will do what you need, but it has a tendency to 'log jamb' on differing element heights.
I have used Semantic Views to create continuous, wrap-around content from multiple View rows. I removed the View row element by deleting the default 'div' in the 'Format settings'. That way only a continuous stream of fields appears within the '.view-content' tag.
A custom template is also good.

Magento catalog image change on hover

On the catalog/category page I would like images change when hover. Like clubmonaco.com I know how to do it on html/css but no idea on magento. Any help?
You could modify files in this directory:
app/design/frontend/base/default/template/catalog/product
for example (list/ and list.phtml)
or your template for example:
app/design/frontend/default/yourtemplate/template/directory with product files
CSS files you can find in:
skin/frontend/
You should also think, where the second image is stored. You can use "CSS-Sprites" for this case - a single image file, that contains both photos. The disadvantage is, that you have to customize every page, where magento shows product images.
Alternatively you have to define exact orders. First image is the front view, second image is always the back view.
The programming part is not really difficult. Look at
app/design/frontend/base/default/template/catalog/product/list.phtml
for the Catalog view. Path can vary, if you have a custom template. In the Magento backend there is a feature to show up the real path (system->configuration->development tools).
You can write your Javascript directly into the list.phtml. Magento also writes JS-code directly in the .phtml files. Of course it's not very pretty, but Magento is so complex; if other people work with the shop system, it will be easier to find.
Keep in mind, that the list.phtml contains two layouts: Grid and List View. Just if you do a change and wonder, why you can't see a change in the frontend ;-)

TinyMCE 3.5.8: Detailed Steps for Creating a Button that Acquires a Value from User and Inserts it Between a Pair of Tags

TinyMCE 3.5.8
I merely need to create a button (and module) that acquires a user-entered value from a popup and places it between two tags, e.g., [bib][/bib]
I am having trouble finding a "step-by-step" for doing this, including what files, where code goes, etc. This must be rather simple?
I have replaced all of the occurrences of "example" with my module name in the "Example" module, but that is where my information ends.
If someone would be so kind !
P.S.: It would be even better if the form field would javascript validate for "integer", but maybe I ask too much?
download the tinymce development version
use tiny_mce_dev.js instead of tinymce.js for developement in order to get more usefull error messages
create an own tinymce plugin (this is not that difficult) that opens a popup
get the content of a popup field
insert it at the right place in the editor
You should have a look at other tinymce plugins (in the plugins directory under the tiny_mce dir) to get to know how some things work. There are many plugins, some of them use popups.
I.E. the searchreplace popup

Drupal views add form to add record

I have some view which lists my module table entries.
What is the most elegant way to attach a form below the view to add record?
Waht I am trying to do know is:
I created dedicated form in my module:
function my_module_form_add_record($form_state) {
form fields.....
}
I added to the view theme file:
$add_form = drupal_get_form('my_module_form_add_record');
print $add_form;
But I do not like this solution for at least 2 reasons:
I does not work ...
2. Even if it worked - it is depended on the theme file! So if I change the theme - functionality is crashed.
I would like to find more elegant solution to attach form from custom module to the view.
I know of the existence of the "Views Attach" module but it has no option of adding custom forms.
I know also of the existence of the Views Embedded form (and I am usig it) but it is only useful if you want to add form to the every row.
Seems the must be some solution to add record from the view page!
Thanks you for help.
you could use hook_views_pre_render:
This hook is called right before the render process. The query has been executed, and the pre_render() phase has already happened for handlers, so all data should be available.
Adding output to the view can be accomplished by placing text on $view->attachment_before and $view->attachment_after. Altering the content can be achieved by editing the items of $view->result.

Resources