Separating nodes - drupal

I am sure this is a simple fix, but cannot manage to work it out. I want to show a teaser only on a single node for my content type (e.g., node/1), and not all nodes within the content type. How would I do this?

There are many ways to do that, depending on what you actually want.
A way would be to have two content types, one for node/1 and one for the other.
You could also solve this from node edit: when you edit the node/1, create a teaser and a full view, but for the others, create just a full view (no teaser). In this case, the other nodes will appear in full view even in lists of nodes.
You can alter the node view inside a hook_nodeapi (in Drupal 6) or hook_node_view (in Drupal 7) and force the full view of the node for any other nodes of a certain type, but not node/1.
Another way of doing this would be to also force the full view for the other nodes except node/1, but in a hook_preprocess function...
Maybe if you describe what you need in a more detailed context, then we can find other ways of doing this...
Vasi.

Create two different displays of the view. On the first, make it a block, and set it to display only one item with the teaser. On the second, don't include a teaser and set the offset (under "items to display") to 1.
Make the first block display above the second display.

Related

How do i combine multiple fields from a view into one hyperlink?

Im sorta stuck on an issue. I have one view where i am displaying 5 fields under an image. These fields are all clickable links or I have explicitly declared them as links.The problem:
I need to combine each field/link into one link. I tried the "Combine Filter" but when i try to combine 3 of the 5 fields i have exposed. the whole view disappears from the preview screen in the View screen.
Is there's something that i could do leveraging drupal or should i use jquery/JavaScript to tackle this?
Thanks!
It would be helpful if you said how you wanted combine them, so I will assume it is similar to the same way I often do.
Views has two checkboxes that you will want to use for this. 1 is the Exclude from Display at the top of the field setting, and 2 is the Rewrite Results > Rewrite the output of this field.
Assuming one field is the the path, two are taxonomy or something, one is the words you want for the link, etc... Either pick the one that links directly where you want it, set it as the last field of the five, and exclude it. Or it does not really matter what order, and just exclude the first four fields of the five. What Exclude does is tell the view to fetch the value, make the token available for you, and not impact the display.
Then in the fifth field you use that Rewrite option. A textbox will appear and below it is the list of available tokens to use. Then you construct the one link that you want composed of the five fields:
`<a href="[field_path]" class="[field_taxononmy] custom" title="[field_example]" >[field_taxonomy] [field_words]</a>`
As they say in the #drupal-support irc, more details will get you a better answer.

Data mysteriously missing from views within same property and account

I've got three views set up for one profile. They were all set up several months ago, at roughly the same time. Of these three, two have data. Both of these have identical filters set up related to IP exclusions. One of these has slightly fewer hits/pagviews/etc. The third view has the identical set of filters, but no data (and has not since it was originally set up).
Has anyone experienced this before? I'm completely at a loss (again, NOT the filters) for root cause.
Thanks!
Are the filters listed in the same order for all the Views?
In the Admin Tab of Analytics, you can go to the Filters section of your Views and compare their order.
Otherwise, you could copy one of the View that has the expected data and incrementally add filters to it until it matches your intended use for it. In the Admin Tab, select a View's View Settings and click the Copy view button.

Customizing Search in Orchard

Is there any option to completely control a Search module with a Summary view? I am struggling to get there. I have the following settings so far:
In admin I created an Index called PublicSearch with a number of fields.
I am getting a search result which is a mixture of two content parts - Question and Expert
I have a Part view to be used in search result for Experts called ExpertSummary.cshtml. The view only contains the following elements now:
#model dynamic
<p>Expert Summary</p>
When the search result is coming I only expect the "Expert Summary" to be visible in Expert region of the Search but I am getting an additional "body" section (truncated to X characters). It seems to me because "body" is selected as a field when I created the Index it is coming up.
Each Expert record has an image of expert which is coming up in the search result and When I take out <Place Fields_MediaPicker="Content:1" /> from Placement.info it disappears, which is fine.
But I want this summary to be completely controllable in ExpertSummary.cshtml - like a two column layout where the left col will hold the expert image and the right one will hold a brief description along with some other info - but everything would be in the View - should not come from Orchard search module as defaults.
In short I want Orchard's Index and Search modules to be functional and working like it is now but the layout and information I want to control completely using custom HTML in Parts/ExpertSummary.cshtml view.
Is this at all possible? If yes, how?
Please suggest. I am completely lost my way in Orchard framework!
I'm not completely sure I understand your question... Orchards search returns a Summary view by default. So you need to control the layout of your summary. Use shape tracing to create a new alternate to change the layout of the summary view. So ExpertSummary won't control the entire layout, it will just control the Expert part. Then use placement to decide what to display. http://docs.orchardproject.net/Documentation/Understanding-placement-info
Also, tagging questions with "orchardcms" will be more useful than "orchardcms-1.7".

Can you have 2 views with separate exposed filters on 1 page?

I have two views loaded on the front page. Both contain exposed filters which when modified, display different content (done using the Better Exposed Filters module).
When modifying one view the URL will be http:example.com/?cid[]=1 and the changes will take effect.
When modifying the other view the URL will be http:example.com/?type[]=marketing_item and the changes will take effect however, this will reset the first view (this problem also happens when reversing the process).
Am I missing something or is this type of functionality not possible?
Process $_GET['cid'] or $_GET['marketing_item'] in argument handling code of your views...

Multiple sections on landing page only

I am very much new to Drupal but am loving it to start with.
I got struck at a point with respect to theaming.
I have a region called 'footer-teaser' just above footer. Its width is 800px. its been split into 3 equal size columns. Each column has the following.
Image of size 120x120
Some teaser text
Link to 'read more'
The design requirement is all the above should be editable by the admin from the admin interface. If its static i would have hardcoded this but since the requirement is dynamic, i am not aware of how to achieve this. I have customised page.tpl for other sections of the page except this.
I am sure someone else would have faced this issue before and was wondering if anyone can direct me in the right direction? Even better if an example is provided.
Cheers
RD
When you say you have a "region" called footer-teaser are you talking about a region in Drupal theming terms, if so skip to part two of this answer.
Part 1, set up a region to put content in.
in your theme.info file you can define regions, these are shown as places to but blocks on the block admin tool. Change your theme.info file to include something like
regions[footerteaser] = Footer Teaser
you will also need to print $footerteaser in the appropriate place in your .tpl file.
Test this works with another existing block before moving to part two.
Part 2, populate the region.
There are many ways you can generate the code to populate this region. I believe the simplest would be to create editable blocks as in the block example module.
If you want static content that is editable from an admin interface, so you don't need to make a list of top nodes and that sort. You can create a block from the block interface, and put any html in it.
If you need to make lists of content etc, you can use the views module to create such blocks.
Else you will have to use the custom block approach that Jeremy suggests.

Resources