In Drupal does content and node refers to new page? - drupal

I am new to Drupal. I've confusion between content and nodes. Can we say always content and node refers to new page?

All content on a Drupal website is stored and treated as "nodes". A node is any piece of individual content, such as a page, poll, article, forum topic, or a blog entry. Comments are not stored as nodes but are always connected to one. Treating all content as nodes allows the flexibility to create new types of content. It also allows you to painlessly apply new features or changes to all content of one type.
A page is always a node, but not all nodes are pages.
Source: https://www.drupal.org/docs/8/core/modules/node/about-nodes

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.

Drupal 7/Views - Showing similar content with the same tag(s) when adding a new piece of content

I'm not sure if this is possible or not, but I'm wondering if when creating a new piece of content (say, an Article), is it possible to show similar pieces of content (which have the same tag(s) as the content you are creating) so that the content creator can pick these items to use as related content.
In other words, it will show related content in the admin view (say, as a list) when you are creating a new piece of content (and not in the normal site view that everyone sees).
The list of related content would need to be ordered by most terms matched.
Thanks, Jamie
Views, similar_by_terms, similar and other modules provide that functionality. See how to create such a block with views at this article http://www.metachunk.com/blog/adding-related-content-view-drupal-7

Create a list in Views of non-node pages created in Views and Custom Pages

I have a fairly large enterprise site and I am needing to create a dynamic HTML site map. Similar to the site map at Apple.
With that in mind, I have created a view that lists all node-based pages (i.e.) those pages created and associated with a content type. The problem is that many of the pages on the site are pages created in Views or in Custom Pages and the url is defined there. These aren't dynamic pages, rather they are pages built to be main pages for different sections.
Example: the site has a team content type. This content holds information about an employe. The page at the node level is site.com/team/john-doe. I've set up a view page with the url site.com/team - This lists the name and a photo of the team member.
This is the case for many sections on the site, since these are important pages I need to somehow create a view that lists these pages so I can then take that view content pane and the node-based content pages and drop that into a custom page to build the HTML site map.
Since these custom pages aren't stored in the db I am not sure how I can get views to extract that data and render it as a list.
Any suggestions?
I think what you are looking to achieve is going to be driven more by menus than by views or nodes, custom or otherwise. The menu system contains references to all paths on the site, whether they were created by nodes, views, taxonomies, custom code, etc.
You might find the Menu Views module useful for this:
http://drupal.org/project/menu_views
For a slightly different approach, I would also suggest looking at the Site Map module:
http://drupal.org/project/site_map

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

Drupal: Template Files, Modules and Content Types for Advanced Theme

Intro
I am in the process of trying to convert my first HTML/CSS design into a theme for Drupal. I have used ModX for quite a few designs and appreciate the ability to create different page templates and custom variables to be assigned to those templates. However I seem to be having some issues making the transition.
The site I am working on theming in Drupal is for a real estate agent. Each page/section will have a different set of content associated with it and will need to display only that content. For example, there will be a page for current listings, each of which will be formatted by a custom content type. However, when I call the content on the home page (or on other pages) I do not want to see this listing data.
Layout
The layout of the site and the regions associated with each page/section is as follows:
Home
Spotlight
Featured 1
Featured 2
About
Spotlight
Bios - Profiles of each agent (each will be a node with name, contact info, pic, etc) listed on the page; multiple nodes listed
Sidebar
Listings
Spotlight
Listings - Profiles of properties (each will be a node with locations, basic info, pic, etc) listed on the page; multiple nodes listed
Sidebar
Services
Spotlight
Content - general paragraph text area
Sidebar
News/Blog
News/Blog Items - List of stories with summaries and links to full article
Sidebar
Each page/section will use the same header and footer.
Issue
I have done some reading on Drupal, custom content types (and CCK), Views, and Pathauto. However I have not been able to get a clear picture of how to put it all together to accomplish what I am attempting. What I really would like to know is which modules to use, how best to use them, which elements I need to use where, and what template files I should be using to theme the elements I need to use. Any help or reference to useful resources would be much appreciated.
This is a rather general question, and your description is a kind of vague on important distinctions like page vs. site section vs. page region. That said, some general advice: start by installing the admin module. Then get all your content generally in the right places with someone else's theme, e.g. Garland, before you start doing any of your own theming. You should be able to get pretty far without touching code. Use CCK to define your content structure. You should already have a type for page and it sounds like you'll want to add a type for feature, bio, listing, and blog post. Depending on the details, you may need to add some additional field modules, e.g. if you have images, you'll probably want the imagefield module.
Once you have the content types defined, configure pathauto, and start adding content.
Once you have some content, you'll want to create some lists of it with views. You may want to start with the simpleviews module, as the views UI can be overwhelming. Save your views as block display, and then use the blocks admin to put the in the right page region, and configure them to show up only on the right pages.
At that point, you'll want to start controlling how the individual items (nodes) look in different contexts. That's when you start theming. For that, I'd install the devel module, look at what other themes do, and call dsm() on any variables you don't understand to see what they look like.
You can generally get quick help with specific questions on the Drupal IRC channels.
The easiest way to do what you want to do may be to put your custom content in blocks and set the access settings for the blocks to be only on certain pages. So, for instance if you have content that you want to appear at /spotlight or /node/22 or such, you would just create a custom block (Site Building -> Blocks) and then in the settings, set the block to only show for that node.

Resources