How to list most visited links in Drupal from different pages? - drupal-7

I have made one block for most visited links (Top Links) in my drupal website but I dont know how to list most visited from different pages. For example, if I have created a page named drupal and within that page i have added some content with some title, then i have to examine and count those titles and list the top visited title from each and every page on my homepage(only one from each and every title that is most visited) and list them on my homepage block.
Could anyone help me with this.
Thanks in advance!

Make sure the statistics module is enabled. Visit /admin/config/system/statistics (Drupal 7) and make sure Count content views is enabled (ticked).
Use views to create a block the usual way; for example add a field like Content: Title. Then make sure you add a sort criteria of Content statistics: Total views (desc).

Related

CouchCMS Blog index items to display inline (blog_list.html)

I've used Couch CMS to create a blog page with index of articles.
I've used Couch for blog systems before and the blog index item always displays underneath each other. However, this time they must display next to each other. I've tried so many things, but the index items remains under each other oppose to next to each other. The website is based on bootstrap, but the columns just keep on stacking on top of each other.
Can someone please help?
URL: https://legacyeb.co.za/news.php
Solved. Just make sure the couch page open and page close tags are in the correct place.
Everything in between the tags gets repeated with the blog index.

Drupal 7 basic page with a dynamic block with arguments

Can anyone guide me to a route to take as far as making a basic page in drupal 7 and then having that page load a block with images inside based on URL path.
So I have a content type that is for 1 type of pages and another content type for another type of page. Each content type has 30 pages. I don't want to create 30 pages for 1 page that will have the same content over and over but with a different logo.
http://www.example.com/contenttype1name/%/staticname
I need to make the menu have an argument passed and then based on what is passed go get the correct image.
Sorry if this is confusing. Thanks for your help.
You should look into the views module - it allows you to easily create a view with dynamic parameters (contextual filters) that allow you to easily tackle things like this.
I used contextual filters on views and nodesymlinks along with panels that was already installed.
Modules Used:
Views
Nodesymlinks
Panels
Step 1: admin > Modules > Add Modules/Enable.
Enable Nodesymlinks
Enable Panels and panelizer
Step 2: admin > Structure > Views > Add View.
Make view, name it and check block not page (I used Fields).
Step 3: admin > Structure > Views > your view.
Add filtered Criteria - Content type = your type.
Content should be Published only.
Add contextual filter: title.
Configure contextual filter: Content: Title.
Provide default value. Select Raw Value from URL.
Path component select 2. You can add it where you want in the URL.
Use path alias and check it.
Under More you need to check this box: Transform spaces to dashes in URL.
Check it in Views and save.
Step 4: admin > Content > Add Page.
Add a basic page.
On the bottom of the page you will see: Provide a menu link. You want to check that box. Now you will be able to add all the menu links that you wish this page to show up on. Add links/Paths and titles. Make sure you use argument 2 in your link to be your content on the views block in step 3.
Step 5: admin > config > content > panelizer.
You want to go into this pages panelizer, could be basic or whatever your content type would be. Add your views block and save.
Step 6:
Test it. If it doesn't work then you need to check your titles in argument 2 in the URL. Worked for me. Saved me a ton of time.

Get content Id (nid) from path on views block

I just can't seem to wrap my head around Drupal relationships. I have been reading and watching tutorials, but as soon as I try to get my own project done - I fail. I think it's very basic, so I would love to understand it. Maybe someone here can help me understand how it works :)
On my drupal site, I want to keep track of some private game tournaments.
I have created a content type called contestant, which has fields like: Tournament date, Player name, Final Position. I can then create a view that list the information from one tournament. I used the help I got from this thread: drupal views dynamic filter
I would like to have the view described above as a block. And then place that block-view on a "tournament description" page. I could do this, by simply creating a new block each time, and then manually place it on the page it should be shown (structure-->Blocks-->configure), but that is not an elegant way to do it. I am pretty sure this is where Relationships should be used. But I fail to understand how to create this relationship, so that the specific block view, that matches the specific tournament description page will be displayed together.
Use a Content:Nid as a Contextual filter.
WHEN the Filter value is not in the URL >>
Provide default value
Content ID from URL

How to know the link clicked by the user to set the breadcrumb using views in drupal 7?

I'll try to explain my problem giving a little context first.
I'm building a catalog of products and to categorize them I'm using a taxonomy tree with 4 sublevels. Each product can be related with one or more subcategories.
I used views to navigate the taxonomy tree to access the products related with each subcategory. To manage the breadcrumbs in here I redefined the hook_breadcrumb() function on my template.php and this is working perfectly.
The problems start here: when I get to the last level of subcategories I have the respective products and when I click one of the products it will enter the node page of that product. At this time I lose my breadcrumb trail because I entered the node. I could get the taxonomy tree of that product to build the breadcrumbs but the problem is that the product can be related with multiple subcategory terms.
So, in order to solve this problem I think that I need to know from wich path trail the visitor arrived to the product. In other words, I need to know the last taxonomy subcategory that the user visited to enter a specific product so that I can build the breadcrumbs correctly with that information.
So, can someone help me on how to know the path that the user was before entering a node?
Thanks in advance!
You can check http://drupal.org/project/cookiecrumbs a recent project which uses browsers history to show breadcrumb

How to manage no of node in taxonomy page?

I am developing site using Drupal7 with JD Fashion theme from Joomlart
I have created one vocabulary and terms it in the taxonomy.I have use this terms for menu navigation and added some stories(node) for each menu item.
In post setting I have kept no of nodes in main page to 3 using admin/content management/post setting.
But it is only working for home page and not for inner pages.
I want to restrict the no of nodes to 3.
How can i do that?
Is their any module or extension for pagination to control no of article per page?
You can turn on the Taxonomy Term view in the Views UI to have more control over the taxonomy pages. This view is automatically generated by the Taxonomy module, but is disabled by default.
Once turned on you can set the Pager in the Page setting area to Display a specified number of items and set the numer of Items per page to the desired number.
This will limit the number of nodes displayed in the Taxonomy pages.
You can do this without views.
The number of nodes displayied in taxonomy page is determined by the default_nodes_main variable, that also controls, the n° of nodes in the home page and the number of blog posts.
You can adjust that at admin/config/system/site-information > front page > n° of nodes in front page.
So, beware of side effects. I made a search in all of the D7 code and i found out that default_nodes_main appears in
blog.pages.inc:26
blog.pages.inc:66, limiting the number of post
node.module:2601, limiting the number of sticky nodes (front page)
taxonomy_pages.inc:55, limiting number of nodes in the taxonomty page
Known the consequences, you can use that setting.

Resources