Show/Order custom content in Main Page Summary - drupal

I am developing a site using Ubercart that shows product summaries on the main page (I believe these are called teasers). Each product has a voting widget provided by Vote Up/Down on its actual node/page. I've copied page.tpl.php to page-front.tpl.php because I want to add a small block or box that shows the number of upvotes on the main page (but not actually allow voting here) and finally sort these teasers by popularity (number of votes).
I can see that print $content is outputting this page's content but I am not sure where this is being generated so I can either hook into it or modify directly. I've coded themes and plugins in Wordpress but I don't know Drupal well enough yet.
Thanks in advance.

You should first know what is generating your front-page. Is it Views? Or another module?
If it's Views, you can easily add the vote count from the Drupal backend. If it's another thing, depending on what it is there are ways to change the output.

Related

wordpress website- implement search sort and filter

i am using avada fusion theme in my wordpress site, different plugins work fine if i need to search posts and pages, but i need to search/sort/filter in a page where i have created 100+ containers/items as a list(like slides or templates).
how can i get it done?
And also what would be a good approach if my list is going to be long i.e 400+ in near future?
re: i have different graphical and text included items in a page with same templates, and i need to search, sort, filter from that list in that page.
I do not see any option to tag or id each template/containers in page which would make search/sort easy.
thank you in advance

Views and Categories...?

it's about this page: http://veagues.com/
Hey guys,
I've made a block-view with drupal that let's me sort my videos by a certain category, in this case "funny","epic","plays", "contest"...
The problem is: When you sort it by the certain category and click on a video and continue to click the "next" button, you will go threw all videos, instead of only the videos of the category...
My Question is: How can I put a filter on the nodes when i apply another category on the bottom block?
Thanks already!
If you're using Views, you should be able to filter the main block by the same taxonomy term.
Try adding a Contextual Filter to that block too. If there's a taxonomy term ID in the URL the block gets filtered by that Term ID and if there's no result, the block shows all the videos.
EDIT -----------------------------------------------------------------------------------------
You may need to try & understand what goes on when you make a selection in Drupal.
1/ The taxonomy term page will list all the content affixed with a specific term. The term tid can be seen in the URL, unless an alias have been created. A block can retrieve that term id, whether there is an alias or not.
2/ The node page will give you access to a specific node, but any block on that page should be able to access the term id of that specific node.
If you know where you are, it becomes easier to retrieve the info you're looking for. On the other hand, you may have to reconfigure a specific page in order to add the necessary extra block...
That can be done with templates but you could also have a look at Panels.
The Panels UI makes it easier to configure the page you're looking for without having to mess with code or templates, or both.
There's a lot of free video tutorials out there, search for Views & Panels.
If you want to have a look at preprocess functions, you will definitely need to download the Devel module...
...but have a look at these sites first:
http://codekarate.com/
http://drupalize.me/
http://buildamodule.com

Panels linking to articles or pages

New to Drupal. Installed it, set Bartik theme as default, created a few pages with a menu. Now I would like to do something like this:
where the pictures with descriptions link to either other pages or articles. Each of them should have custom size.
What is the simplest way to do it?
For the testing I have created 4 articles on my home page, but obviously they sit one on top of each other. The same happens when I add blocks.
There is not better option to this than to install and use Views module. You can achieve exactly what you want using the nice UI it provides.
You need Views if
You like the default front page view, but you find you want to sort it differently.
You like the default taxonomy/term view, but you find you want to sort it differently; for example, alphabetically.
You use /tracker, but you want to restrict it to posts of a certain type.
You like the idea of the 'article' module, but it doesn't display articles the way you like.
You want a way to display a block with the 5 most recent posts of some particular type.
You want to provide 'unread forum posts'.
You want a monthly archive similar to the typical Movable Type/Wordpress archives that displays a link to the in the form of "Month, YYYY (X)" where X is the number of posts that month, and displays them in a block. The links lead to a simple list of posts for that month.
P.S - Views module is the most used and installed module in Drupal, hence, it will be a part of Drupal 8 core.

Concrete5 Custom Content Types (Blocks)

Is there anywhere online where one can find how to create custom blocks in the same way we can create custom content types in Wordpress. The desired result is to add a block that will allow the user to add/edit custom fields like client name, portfolio description, portfolio thumbnail.
I've created a free tool called "Designer Content" that lets you easily generate these custom blocks:
http://www.concrete5.org/marketplace/addons/designer-content
That being said, it is important to understand this key concept: In Concrete5, everything revolves around PAGES. In general, you want to try to establish an architecture where each piece of data is represented on its own page (a "details" page, which would roughly equate to a single blog post in Wordpress). Then you use the Page List block (usually creating a custom template for it to modify its look) to list out titles, links, and excerpts/photos from each of those "details" pages on a top-level "index" page (roughly equivalant to the home page or category archive in Wordpress).
For example, if you're building a portfolio site, you might want one top-level "Portfolio" page that shows a thumbnail and title of each piece, then a "Portfolio Item Detail" page type that contains one piece per page -- each living underneath the top-level "portfolio" index page.
The benefits of this approach are C5 gives you out-of-the-box tools to manage your "data" (pages) in this way -- users can add, edit, delete, and rearrange the pages via the "Sitemap" in the dashboard. Site search works without any modification -- each page (i.e. portfolio piece) will be its own search result with a link to a specific page. Also you then have more fine-grained control over access permissions if you ever decide to restrict access to only certain groups of people (registered users, etc.).
If you take this approach, you might find the "Page List Teasers" addon helpful (it will let the Page List block -- which you're using for your top-level "index" page -- to show actual content excepts from the pages instead of just a separate "description" field):
http://www.concrete5.org/marketplace/addons/page-list-teasers
Or if you want to dive deeper and customize the page list template even more, I have a starting template with a ton of code comments in it explaining how to do different things here:
https://github.com/jordanlev/c5_clean_block_templates/blob/master/page_list/view.php
But... if you're only talking about small amounts of information and you think a separate page for each one is overkill, then the Designer Content approach I linked to first will work just fine.
You can find a HOW-TO on creating new blocks written by Franz Maruna on the concrete5 website.
Here is the link: Creating a New Block Type
There is also a simple block you can download and install to help you follow the developer tutorials. You can find that here: Simple block template

Problem attaching Ubercart view to relevant content

Example page: http://giantcalculator.com/content/cartridge-filters
It’s very cumbersome to connect the ubercart view to a relevant content page. In the example above I have attached the view to the bottom; you can scroll down to see it. It is a tedius process though in which I have to create the view, then create a mini panel, include the view in the mini panel, then go to blocks page and add the mini panel to region (currently a region below the main content), then I have to configure the block so the view only appears on it’s one particular page.
This seems far too complicated and the particular region will soon have about 20 blocks inside it, though each only appearing on one page. Is there a better way to attach a view to its relevant content info, or vice versa?
I know the view creates a page of its own, and if I could add the content on top of the view that would be great. Or within the view itself, can the content be added somehow?
I'm almost ready to move forward with this site but I really need to find if there is a better method first. I'm posting this in a number of places and offering a $20 bounty via paypal to the first responder with best alternative that I end up using. (if there is one). Bounty may be shared if two or more people have the same response on different forums and I can't tell who was first, though when I do have an answer I'll promptly post it.
Other forums this will post include Drupal.org paid forum, Ubercart Bounty forum, aardvark, superuser and stackoverflow.
If I understand correctly, I think the piece of the puzzle you're missing is Views arguments. If you ever find yourself creating more than one view, where the only difference is the content (ie. based on taxonomy, or a certain CCK field), you probably want to use that as an argument in the view so it loads the correct content automatically.
I assume "cartridge filters" is a taxonomy term, and the page linked above is a node with this term applied. So you'd add a taxonomy arg to your view in the Views admin, and get it to pull the term from the current node. There are a bunch of tutorials out there on this, and here's a screencast: http://gotdrupal.com/videos/drupal-views-arguments
I'm also not sure why you're using mini panels. They're generally used for sets of blocks or other content to be displayed repeatedly, like a tabbed block or footer. It sounds like you just want a regular block display of the aforementioned view. You could also make this entire page a Panel.

Resources