Sitecore how to manage duplicate content - asp.net

I'm currently developing a website in Sitecore where there will be three distinct areas which have the same structure down to level 2 pages, beyond this level structure is likely to diverge. Some of these pages will have identical content across each structure, whereas some will be unique. The content is something like this:
home\section-1-home\sub-page-1 (identical content between the three sections)
\sub-page-2 (identical content between the three sections)
\sub-page-3 (different content for each section)
\section-2-home\sub-page-1
\sub-page-2
\sub-page-3
\section-3-home\sub-page-1
\sub-page-2
\sub-page-3
\sub-page-4 (extra page, unique to this section)
Is there a way to manage this scenario in Sitecore?
I've had two ideas how to manage this so far:
1) Set up some kind of custom publishing action which merges content from a nominated 'master' version of a page, to the slave versions of the same page.
2) Create a master content tree (at the same level as home and thus not directly browsable), then do something clever to the Sitecore Context object to make it point to an item in this master content tree instead of the current item.
Edit:
Just to clarify; I'm using Sitecore 6.2 for this site and at the moment, changing to another version of Sitecore isn't an option :-(

If you're working with Sitecore 6.4 then you may want to look at item cloning. You can clone a single item or even an entire branch of the content tree. A clone will get its data from its parent, though individual fields of the item can be overwritten.
Considerations for Sitecore 6.4 architecture for multiple site, multiple language open ended solution?
http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2010/10/Sitecore-CMS-6-4-Cloning.aspx
If you're staying with an earlier version then you should read this:
http://sdn.sitecore.net/upload/sitecore6/sc62keywords/reusing_and_sharing_data_sc62_a4001.pdf
They'll update that document to include cloning sometime...

If I understood your problem correctly, then there are various ways you can do this, i will only mention a couple
Create a custom 'shared content' section in your tree and then with in each section create a 'shared content sublayout/renderer' and set the source of the sublyout to the shared content
Other option could be to consider on section as the master section and then hook into either save or publishing piplines and create/clone your items.

You might find this thread useful:
Retrieving Sitecore items Position A in the content tree and to the user in Position B

You could also you proxies, which work with a lot of version of Sitecore (5.3 to at least 6), which let you create "copies" of items.
You need to enable them in the web.config though and there are some draw backs.
For Sitecore 6 see:
http://sdn.sitecore.net/upload/sitecore6/64/reusing_and_sharing_data-a4.pdf#search=%22proxies%22
Or do a search on proxies on the SDN.

Related

Report of Pages Author (Publisher) name

I'm working on a large scale content-base website
in this website many Users produce content in many type of pages, and i want to know how many users(author) create how many page and produce content (for example in this month)
(no difference on reports or front-end)
is there any add-on?
There is no addon for this. First you have to define what "create how many page" and "produce content".. is this the the act of adding a page? or publishing the page? it editing the page at all producing content?
There is a "core" report in the cms module named Recently Edited. You can examine this to determine how reports work. Then you will need to add various extension "hooks" to track the operations required...
onBeforeWrite
onAfterWrite
onBeforePublish
onAfterPublish
Within these methods you will probably need to log the data you wish to report on along with Member::currentUserID() and remember while in an extenstion to access the object you need to use $this->owner->FieldName (instead of ($this->FieldName).

WordPress - add Database driven tables

I'm just trying to move one of my old php sites to wordpress. As part of the site I have 'top tables' e.g. top 10 cars, listing their features etc. At the moment that all comes from a database and the HTML is generated from the data.
So if a car soon gets a hybrid engine I just check that in the database and my web site table updates to reflect that.
This all works fine. I just don't know where to start when trying to implement something like this in wordpress. I want to keep the WP header, footer, nav... and put my table in to the content area.
Someone recommended simply copying the current generated HTML in to a new post and editing the HTML when anything changes, this sounds like a quick solution but there must be a better way of doing this.
Ideally I would want to keep my current data input pages (and separate database) for all of this 'table data' and present the out put as a post.
If anyone can point me in the right direction (key words I should search for, a guide) that would be great.
Depending on your usecase, you'll usually want to use a static page template:
http://codex.wordpress.org/Page_Templates
Or shortcodes:
http://codex.wordpress.org/Shortcode_API

Find every instance of a CSS id/class across a whole site

Before making a CSS change that might possibly have unintended consequences, what's a good way to find where else on the whole site (not just this page) that id or class is used? (It doesn't have to be exhaustive, and semi-manual processes are ok, too.)
For a bit of context, it's a Joomla-based site with a lot of content, and I'm not yet familiar with most of it. The id in question has a two letter name, and I have no idea where else it might be used. I don't have direct access to the server for any grep-like approaches.
The only technique I can think of is using Stylish to make an obvious change to that one selector, and browsing the site for a bit to see where it pops up.
The easiest way would be a local grep, but since you don't have access to the server, try downloading it locally using wget:
wget -r -l --domains=http://yourdomain.com http://yourdomain.com
That'll recursively retrieve pages from your domain to an infinite depth, but only following links to pages within your domain.
Once it's on disk, do a local grep and you're golden.
I use unused-css.com for this sort of thing. You simply put in your webpage, and it will look through the whole site (incl. login) and give you the CSS that you actually are using.
I've found it to be 95% correct - but it only doesn't pick up on things like some CSS browser hacks and some errors (ie. the CSS only displays after an error), so it should work fine for this.
You could also check the original template (assuming the template is a commercial one) to see where the id perhaps should be (they usually lay everything out in their demo template), but unused-css won't tell you exactly where it is used, only if it is or not. For that, I'd start with a view-source -> find on the major pages, and then try other mentioned solutions.
Get the whole site's source tree into an IDE like NetBeans or Eclipse and then do a recursive search for id="theid" on the root folder.
If this is not possible, how are you updating the CSS?
Assuming you don't want to do the grep approach:
Is the ID in question appearing in the actual content area of the page, or in the 'surrounding' areas? If it seems like it's not part of the content, but rather appears in a template, you could search the template files for it. As you're updating the CSS, I'm going to assume you can at least get a hold of the template files. Many text editors/IDE's will let you do a 'global search'. I'd load the template files in TextMate (my texteditor of choice) and do a "search in project" for the particular ID.
That will at least give you a semblance of an idea of where in the site that ID shows up. No, it won't be every 'page', but you'll know what kind of page it appears on (which, with a CMS, is really what you're after).
If the ID in question appears in the content, that is, it was hand-entered by content creators, you'll have to go another route. Do you have access to the database? If you can get a dump of the database (I think Joomla! is MySQL based), you can open the sql in something like Sequel Pro and do a search in the content records for that ID.
This is not actually as hard as it sounds. First place to look the index.php file for the template. This file should be pretty small without a ton of code unless the template is from a developer that uses a template framework. If the ID is in there, then it will show up on every page in the website since this is the foundation that every page is built on.
If you don't find it in there, then you need to determine whether it is displaying in a module position or in the component area. You should be able to tell the difference by looking at the index.php file from the template.
If it's in a module position, then the ID should only show up in instances of that particular module.
If it's in the component area, then it should only display in any pages being created by the component. That does leave the possibility of it affecting many elements you don't want changed. But there is a solution for that. you can use the page class suffix in a menu item to add a unique id/class to the page you want to change (depends on your template). With that unique suffix you can create a specific selector that will only affect the pages you want to change.

Drupal Site Index - not crawling through "Blocks"?

I created a "View"* in Drupal to grab all the content and essentially make a site map, but I realized that it doesn't have an option to grab content from the Blocks I have created. Does anyone have an idea if I can even do that?
If not, should I essentially make each block a page so that it can crawl through the pages? I worry that this will end up becoming unmanageable in the end... What are some other options/work arounds? My end goal is to make a site map - maybe I am making this too complicated?
*To make my view I did:
Administration->Structure->Views->Add. Then I made it a page, called it "site-index", and made it "show Content of type All" (with tagged field empty). Then I chose "Content: Title" for my Fields and my Filter Criteria is set as: "Content: Published (Yes):" - That way, it will grab the titles of my web pages.
Thanks, and please reply if further clarification is needed!
Apologies if I'm wrong but I think there might be a bit of confusion over terminology here. In the context of a view Content means nodes, not all HTML content on the site. Your view will return a list of all published nodes, which are essentially the pages on your site.
On a normal sitemap (if there is such a thing) you would only link to full pages, not to parts of pages like a block, they are essentially used to provide a hierarchical overview of your site to aid navigation for users and, probably more importantly these days, search engines (you can submit an XML sitemap to the major search engines instead of this but that's really for another question).
Rather than doing this yourself I'd actually recommend you download and install the Sitemap module which will do all of the work for you, as well as arranging the content in their respective hierarchy.

Drupal: best practice to arrange various Drupal entities into one site /subsection

It's perhaps a common task to create a subsection on site, which will reside under sitename.com/subpath.
The subsection will contain own menu with a few links (Calendar view, Add MyEvent content type form, Table View).
But clicking these links will lead out of this /subpath.
Is there a know solution for this (to stay in subsection)?
Or it's normal to use custom code to manage such a subsection, e.g. create pages under /subpath with custom PHP code that will load CCK forms (drupal_get_form())?
Also, is it a tolerable solution to modify from "View links to node forms" to "View links to /subpath pages with programmatically created node forms"?
I'm not sure I completely understood your question - if I didn't and I'm off-topic, I apologize in advance.
Anyway:
Creating pages with code in them using PHP filter, is never accepted practice. There's a reason why the filter was moved to its own module in 6.x - so you can turn it off altogether.
You can go to Site building->URL aliases->Create alias and point the wanted system paths (say, node/add/mycontent) to your subsection path (say, mysection/add/mycontent). All the links to the system path should change to the new alias.
EDIT:
Also, check out pathauto and Sub-path URL Aliases for paths like node/1 and node/1/edit

Resources