1- i have menu links HOME | Property(links to property content type) | NEWS.
2- In every News there are tags which reference to the property.
3- I want to link "NEWS" menu item to a separate page which should display only the news list which contains the tags for the property.
Example
i am on a property page say "Property XYZ", so there is a menu item "NEWS", when i click this menu item, a new page opens and this page is showing news which contain the Tag "Property XYZ" in them.
How to do this thing? Thanks in advance.
You can use the Views module to create a new View of nodes of type News, with a display of type Page (since you want the News listing to be a separate page).
Then you can add a Contextual Filter to the View, which is the way you can pass the Property as a parameter to filter to only News with that Property as a tag. You do this by adding the News field containing the tags as Contextual Filter for the view.
At this point you'll have a view page with something like 'news/%' as a path (where % is a placeholder for the Property parameter), so then you only need to use the appropriate substitution for it in each Property page for the News link on that page (like make it link to 'news/propertyxyz' while on PropertyXYZ page).
If the menu containing the NEWS menu item is outside of the scope of the Property page (like in the case of the site main menu or something like that) then you can use https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu_link_alter/7.x to alter the path, getting the corresponding Property object (and any value you need to pass as parameter) through https://api.drupal.org/api/drupal/includes%21menu.inc/function/menu_get_object/7.x
Related
I'm pretty new to Drupal,
I have created a View with a custom content type which includes a field collection. When i try to load this view block inside a region in front page, It just shows the title (with the link to the actual content) and not the content itself. I need to view the content in the front-page itself
Can you please help me how to do this?
There are two options:
if in view you selected show format as content then you have to add your field collection field in selected display
if in view you selected shoq format as fields then you have to add your field collection field in view fields section
How can I create a navigation menu data type with submenu items so that I can create it in the back office with properties like text, href, optional image? Something like dropdown multiple.
I've installed Umbraco 7.1.5 with NuGet in VS2013 and using Razor syntax.
EDIT:
Is it possible to create an object of type menu and edit it in the back-end's UI, for a non-developer. The user should add as many items or sub items as needed with those properties, with a plus sign. I've found this property editor. Is this possible using this property editor?
Create a Partial View (in the back-end under the SETTINGS section). If you create a new partial view, one of the pre-created snippets will be "navigation".
Then use some CSS menu (you e.g. created yourself or found on google), and try to match the navigation HTML to that of the CSS menu.
To include the partial view in the template just use
#Html.Partial("NameOfThePartialWithoutExtention")
i am using menu controls on my master-page and have used sitemap data-source to populate it. It shows main node on menu. is there a way that it populates the menu with sub-nodes of my master node rather than using default "home" ie masternode as starting menu item.
when you create a site map, you always design your properties in a way that it suites your web needs, They will contain, your starting node, name display, view state and autopostback.
Check your sipemapdatasource properties and your will know how to do that
You just simply put the ShowStartingNode = False in the SiteMapDataSource properties.
IT was simpler than i thoght.
In the TextImage component, the Style tab has lost the css selection dropdown that used to show up when editing the component. It now just shows a blank area. It should have a dropdown for image alignment (left or right are your choices). This doesn't appear anymore.
This tab is xtype componentstyles (String), so I don't know where it references the source for the dropdown values. My local instance of CQ5 works just fine.
I cannot just add an xtype selection and feed it values because the css that gets added to the JSP code is outside the component's .jsp-specific page
It looks like the componentstyles xtype is driven by the CQ design that is associated to the page. Designs are stored underneath /etc/designs and are assigned through a page's Page properties dialog (cq:designPath property)
Let's look at an example in the Geometrixx website. If you navigate to the English homepage # /content/geometrixx/en.html and add an instance of the TextImage component to the page, you will notice that the Styles tab is empty in the component dialog. Now navigate to the 'Discover Geometrixx' page # /geometrixx/en/company/discover_geometrixx.html and examine one of the two pre-existing instances of the TextImage component. The Styles tab has the image dropdown you mentioned!
So what is the difference between the instances on the 'Discover Page' and the 'Home' page? The answer is in the design definition. If you open up CRXDE Lite and navigate to the Geometrixx design page for the Content Page template (which the 'Discover Geometrixx' page adopts), you will see the following nodes:
/etc/designs/geometrixx/jcr:content/contentpage/par/textimage
/etc/designs/geometrixx/jcr:content/contentpage/par/textimage/cq:styles
/etc/designs/geometrixx/jcr:content/contentpage/par/textimage/cq:styles/imagealign
/etc/designs/geometrixx/jcr:content/contentpage/par/textimage/cq:styles/imagealign/image_left
/etc/designs/geometrixx/jcr:content/contentpage/par/textimage/cq:styles/imagealign/image_right
The design for the Homepage template (which the 'Home' page adopts) is missing this definition.
If you want to continue to use the out of box TextImage component, it seems you will need to have this design configuration set up on all the paragraph systems and templates where the component can go. So for example, if you want these styles to be available to the TextImage component when it is added to the par paragraph system of the Homepage template, you would add similar style nodes to:
/etc/designs/geometrixx/jcr:content/homepage/par/textimage/cq:styles
Alternatively you could just overlay the component and/or create your own. Then for this custom component you could create your own Styles dialog that is independent of the design. You can simulate the out of box behavior by examining the saved JCR property and setting the appropriate CSS class name in your render script.
The problem is that a design path variable went missing. We don't know why or how, but the solution is as follows.
Open up Content Repository
Go to /content/-sitefolder-/ and expand
Click on jcr:content and view properties
Check for attribute cq:designPath and its value
/etc/designs/-sitefolder-; add to properties if it doesn't exist
In a node creation form, which is a custom content type, I want to add a text, not a text input field, but just a text line, as a remark or an NB, I search for long time in vain.
How can I do that?
Are you using the FieldGroup (http://drupal.org/project/field_group) module? If so, when creating a field-group for a content type's fields, select Vertical Tab as the type of fieldgroup and once you've placed the fields you want to include 'under' that group, save the page. You will then see a gear icon listed under the Operations menu within the row for your newly created field-group. Clicking on this gear icon will give you some additional options, including a Description area where you can write in instructions or whatever you like that will display on the node creation page within that particular tab and at the top of all the fields you have in that tab.
You should be able to add text using the markup form element.
Description: Generate generic markup for display inside forms.
Example from the documentation:
$form['contact_information'] = array('#markup' => variable_get('contact_form_information',
t('You can leave us a message using the contact form below.')),
);
This will work to give you overall instructions for the node creation form:
Create a new block.
Don't give the block a title.
Set block body to whatever you want the instructions for the node form to be.
Under the "Pages" option of the block creation set "Only the listed pages". Then add "node/add/[custom-content-type]" for whatever type of content it is.
Drag the new block to the top of your content section of your active theme.