How to create a simple company blog with a Tag-Cloud in Drupal-6? - drupal

I have to create a simple company blog within drupal-6. That means there should be only one single blog each user can post into.
What i have done so far is to create a custom content Type (blog) and a view that displays teasers of the recent blog entries with links to the full blog post.
Now i have to create a Tag-Cloud for this blog.
I created a taxonomy vocabulary for this "blog" content type and set the settings to Tags (Terms are created by users when submitting posts by typing a comma separated list.)
I also installed the Tagadelic Module and created a tag cloud with it, that works great and it displays all the Tags i entered when creating new blog entires.
But now to my problems:
First: If i click on an entry in this tag-cloud the default Taxonomy_term view is used to display the resulting blog entries. Thats bad because i would like to have it displayed the same way as in the view i already defined to show the blogs. Is there a way to use my view to display the results of the tag-cloud?
Second: On my view, below each blog-teaser should be a link to related blog entries (the ones that share the same terms). I do not have a clue how to do that.
is this even possible with the setting i have now or should i maybe take a whole other approach to create that company blog with tag clouds and related blog entries?

You should be able to solve both problems pretty easily, while keeping your current approach:
Take a look at your views list ('admin/build/views/list'). You should see a view called 'taxonomy_term (default)', which is usually disabled by default. This is an optional override of the built in taxonomy term page. You can enable this and configure it to look like the blog view you created.
Alternatively, you could leave that one disabled, but add another display of type 'page' to your already existing blog view, and configure that as an override to the built in taxonomy term. For this you'll need to set the path of that display to 'taxonomy/term/%' and adjust the display to use the term id argument as a filter (look at the above override for how this works).
You could also do it the other way round - use the default taxonomy_term override view, configure its output according to your blog view needs, and add another display for your recent blog entries to that. After this, delete your own blog view and use the new display of the taxonomy term override instead.

Related

Drupal- create new block content everytime new content created

I might be asking for a lot , but any help would be awesome! All I want to do is every time a user (not admin) in Drupal creates content like a blog, predefined blocks in certain regions will allow user to add NEW content (ad's/banners). Is this possible?
I've seen the Node-Level Block, but I am not too sure on how to use it? Would this work? How?
Here's an example on what I am asking above. Say a user has permission to create a blog. They will add content to the blog, along with an option to add new content to predefined blocks, like the right side bar block named RightSideBarBlock. This content per block, will be only seen for that new node created from blog content type. If they do not add content to predefined blocks, the block will show nothing for that node.
Does this make sense?
The display part of your request is fairly easy. You don't have to create a new block for each blog entry, you can use the views module to display the related ad for each entry.
Before starting, make sure you have the views module and the entity reference module installed.
First you need a new content type, call it Blog Ad. It will need a field called Owner that will be an entity reference field pointing to the parent blog entry.
Next, create a new view and make sure you choose to create a block variant and set the number of entries to display to 1. Set the filter criteria to Content Type = Blog Ad. Add a context filter to the view. Select Content: Owner from the list of options (this will let you filter the Blog Ad entries by the owning node id). Since block views can't take arguments directly you have to choose the option to provide a default value. From the option list select Content ID from URL. Save your view and go to the Blocks page.
You will now have a block in in your Blocks page called View: < Name of View >. Add that block to the appropriate region, and under settings, filter it to only appear when the content type is Blog.
Now you can create a Blog entry, save it, create a Blog Ad entry selecting the just created Blog entry in the Owner field, then view the Blog entry. You will see your Blog Ad in the block. Create a new Blog entry and when you view it you won't see anything in the Blog Ad block.
Allowing creation of the related Blog Ad from the Blog creation page can be accomplished using a module like Node Reference Create or Inline Entity Form. I have not used any of these modules personally so I can't vouch for their quality or ease of use, but they will do what you want.

Wordpress: Using Custom Post Type for image list of Product

I have a Wordpress-blog with gift ideas where I write text based articles. I recently discovered Custom Post types which I believe is the solution to an feature I want to create.
What I want:
Be able to tag each custom post using the normal "Categories" and "Tags".
Create a 3x3 matrix with product images (custom posts) to be shown on top of each Category-view or Tag-view (followed by the typical article list in the category or tag).
Example:
Lets say I have a category "Gifts for mom" and tags "Pink", "Cheap"
In the category "Gifts for mom" I have 10 text articles (normal posts) discussing the difficulties of buying gifts for your mom
I create nine custom posts, each is a specific gift (e.g. A pink hairbrush). I want to place them in the Category "Gifts for mom" and tag them with "Pink".
When I view myrandomgiftblogname.com/category/gifts-for-mom I want to be able to get a view:
Gifts for mom
Product Product Product
Product Product Product
Product Product Product
Articles:
- This awesome article
- That awesome article
- Etc
I assume this is possible but don't really know where to begin. Could you point me in the right direction? Which Plugins do I need? Do I need to do any programming myself (or just plugin configuration)? Is this even possible?
The description is a bit broad, hence a bit broad answer.
Two things are needed:
1) A plugin to create the Custom Post Type.
It is considered best practice to let CPT's in Plugin territory. So you can swap designs and preserve your CPT functionality. In reality, you are asking for future problems letting this be handled by the theme.
Create your own plugin, which would contain a register_post_type and any extra configs.
Use an existent plugin, like Custom Content Type Manager.
Its Custom Fields features are quite handy as well.
Allows users to create custom content types (also known as post types) and standardized custom fields for each, including dropdowns, checkboxes, and images.
2) Learn how to use and customize WordPress Templates
http://codex.wordpress.org/Templates
Templates are the files which control how your WordPress site will be displayed on the Web. These files draw information from your WordPress MySQL database and generate the HTML code which is sent to the web browser. Through its powerful Theme system, WordPress allows you to define as few or as many Templates as you like all under one Theme. Each of these Template files can be configured for use under specific situations.
You can try the following:
Add a new Page for each category with the exact same name as the category.
In the Images menu attach to each of those pages the images you want.
In your script query for a page with a name identical to the current category, and pull all of its attachments

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

Post privacy in Wordpress

Can a post be hidden from home page, archive view, category lists etc. and viewable only if you have a direct link to it? The blog doesn't have registered readers and is open to public so that would be a mean of hiding some posts from public view without using the password protection.
I asked this question in Wordpress section and the idea there was to use conditional code so I'm asking the question here as well to get closer to the code.
If I used conditioning, would I have to input each post's ID separately to PHP file for archive, categories, search and such?
EDIT:
After reading a bit more all over, I had an idea of creating a private category and then use some kind of conditioning so that posts from that category are hidden. According to Codex, certain category can be hidden from, for example front page but I don't know if there's a way to hide it altogether except when you have a direct link.
Creating a "Private" category is a good solution. It is quite possible to hide this category altogether except via direct link. You just have to "block all the exits" with conditional code.
The default WordPress theme displays posts via the Post Loop. See http://codex.wordpress.org/The_Loop, especially the section entitled "Exclude Posts from Some Category". Just find all the places in your theme's PHP files (e.g. index.php) where this loop is used, and add the conditional code. You'd also need to filter your category list and blog archives in the side menu. Don't add filtering in single.php, otherwise the private post won't display on its own page.
You'd probably want to add a similar condition to filter search results so that private posts aren't leaked via the blog's search tool. There may be more "exits" I haven't thought of, but I'll be sure to update as I do. I'm glad to look at specific code if you so desire.
Understanding WordPress' post query and loop really opens up a world of possibilities for customization.
I found the simplest way - just use Simply Exclude Wordpress plugin. It has the option to exclude each post (or tag, for that matter) from front page, archive, search or feed. It works flawlessly. You can still view the posts by using direct links.
(Not actually an answer that includes code but a working solution nonetheless.)

Different pages for showing different fields of a single node in Drupal 7

Is it possible to elegantly do this? The idea is, a node of content type "project" has a lot of fields, its url is something like node/5. I want to show some of the fields on that page, and others on node/5/extra, kind of an "extended" page that the user only loads if he is interested in that content (lots of images, in my case, that would slow down the main node page considerably).
I tried the Display suite module, unsuccessfully (it seems it's not really meant for doing what I want). I also saw this blog post, which explains how to add a custom display mode to a content type (other than the Default and Teaser ones that come by default), but I can't get it to work the way I want to either.
I guess you could create a view having the node ID as a default argument from URL. Then you can choose which fields to show or hide

Resources