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

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.

Related

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".

Separating nodes

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.

Trouble with getting a sort to work within a view with views_bonus_pack

This is my first time using Views in Drupal and am finding that no matter what I do, I can't seem to get my output to sort on any field at all.
I'm using the views_bonus_pack to create xml output, but not sure if that matters.
I've tried the post date field, the node Id field, the node title field, and... the output is always the same.
Any ideas?
[Update, here are screenshots of what I'm working with]
http://emberapp.com/evanmcd/images/settings-2/sizes/m.png
http://emberapp.com/evanmcd/images/untitled/sizes/m.png
And, here's the resulting XML
http://www.mapendo.org/media_viewer/items.xml
Thanks to anyone who can help.
Evan
The sort criteria are listed to the right side.
Views screenshot http://img.skitch.com/20100715-jcfqnsu8mty6r7mexeyxsis4f4.png
If you changed the sort criteria trying to get differently sorted data without to obtain any difference, then there are just two possibilities:
The sort criteria are not used for feeds; it's rather improbable.
The style plugin module has an issue, and it's not working as it should.
If Views Bonus Pack is implementing a style, each style has its own settings that change the output produced by the style. When you click on the wheel close the style name, you would see some settings fields for that purpose.
Views style http://img.skitch.com/20100711-x3ag3ew6q33r3sje36qdnd4fti.jpg
Views style settings http://img.skitch.com/20100711-mfa6xnx3ca5261uxyq5w6j75g8.jpg

Listing Items and Displaying Data Inline

I use asp.net 3.5 and have also begun looking at 3.5 sp1
I like the clean urls that mvc tends to have but use asp.net webforms for my primary development. I normally use a url rewriter in order to accomplish this type stuff. When I say clean urls I mean like /products to get a list of products and /products/Product_One to look at the info about product called Product_One. I've used this on sites where the listing is on one page and when you pick the item it goes to a different page that shows the info about the item selected.
but
I also like the way that the update panel works and changing stuff on screen with out flashing the screen. When I do this I tend to have a list on the left with the different items that are selectable and then have on the left the data about the selected item, then I use an update panel so that when the item on the left is selected it's data shows up on the left without flashing.
I need opinions on what you all think of the two different methods of displaying a list and seeing the item that is selected's data.
1) Which is better in your opinion?
2) What do you all do to display a list and show the data on one of the items?
3) Is there another way of doing this?
4) Is it possible to combine the update panel method and the nice urls? (i.e. change the url to match the url that would get you to the current displayed data even though the update panel was used, and add to the history the new clean url for the current page)
What you are referring to is AJAX URL history management but you will not be able to modify the URL besides the "#" anchor.
At least not without reloading the page.

Resources