The concept of "web content as database entries" in CMS is just settling in for me in the last few days. Up till now, I've designed and managed websites as actual HTML pages with Dreamweaver (or even Notepad!).

However, I need the ability to have my client(s) edit and update part(s) of their site; I do not want them to have direct access to the pages themselves, rather be able to edit just the part they need as a separate HTML (or PHP) page, say latest news, and have it included in the main news page on their site. They also need the ability to edit online and not with an installed app (so they can get it done from any loacation).

CMS solves the problem of logging in and editing live. But the lack of a true page URL to reference in an include statement is another problem. I tried the node reference of a Drupal "page" in a PHP include but got the main login page included instead! Is it possible in any way to include Drupal (or any other CMS) page in another page? And can I get rid of all the Drupal logos, links, etc. on the "page" to be included so that ONLY the edited text exists on the output node (i.e. "page") to be included?

Thanks in advance!

Comments

nevets’s picture

Lets look at the typical use of content in Drupal. In general it is node based and with core you have the types page and story enabled by default. The blog and forum modules add more content types and using the content construct kit (cck) you can build custom node types. This content by default is displayed at node/{nid} where {nid} is a number. You can use the path module to manual alias the path or path auto to automate the aliasing of nodes. So your client could create/update one or more node types.

If you want to list content on a page by say content type (story, page, etc), taxonomy and more this is where the views modules comes into play. Using the views module you can construct a page with a specific URL that lists content based on some criteria you have chosen.

dotuno’s picture

You, sir or madam, are a heaven-sent! I have more or less completely solved the problem, simply by removing unneeded blocks and theme elements (login, header, footer, etc.) from the pages that will be edited by the client and included in the main pages. I just have 2 issues to get around:

1. The "pages" seem required to have a title. But I can probably get around that by making the title relevant to the parent webpage where it will be included e.g making the title read "News Updates" when being included on the News page.

2. There is a "Home" link at the top of the "page" which gets included along. I will need to find some way to remove that, especially when it links relatively, and is thus linking to a non-existent Drupal parent directory at the inlclude destination (i.e. the News page which is actually a different domain from the one with Drupal where the edits will be made). But I feel I will eventually locate or stumble upon the process. but to have whittled it down thus far is most valued.

A thousand thanks!

miahmiah900’s picture

The solution, rather than have your existing php include the drupal page, is to make your own theme. You can make a very simple theme by copying one of the other themes, then in the page.tpl.php you can add your own HTML code that is the "outside" of the site, and then have the one content hook in the place where you would normally "include" another file:

print $content

Your theme's node.tpl.php file has the hooks in there for page titles and such, so you can delete them if you need, or you can set more style changes in the style.css file for your theme to change how they appear instead. The "Home" link is part of page.tpl.php so you if do as I suggested and delete most of that then the breadcrumb links as they call them wont appear.

You can also set one theme for anonymous users default, and set a regular drupal theme such as the default as the administration theme. That way you can still access all the controls, you just have to go to www.mysite.com/admin to login and start editing stuff in the default theme. All other users that arent given access will see your simple theme. As well, your theme will have links to the main content pages of your site, and each of those pages will have links as needed. You can find out these urls after you have made your content in the administration theme or you can set them with the path module.

Theres a lot of reading to do in order to get up to speed with Drupal site development the easy way, but it's worth it! Check the documentation tab for theme development tutorials and more. With a little PHP skill and some time to read about Drupal, you can make your theme work the right way and ease many of your development headaches, as all the common stuff like relative links and more are done for you by drupal.

dotuno’s picture

Deleted print $breadcrumb; and got that problem solved! Thanks. Still a bit more finetuning to be done, and it should perfectly serve my needs.

Update: A-ha! I should have known the the trick was to tweak the php settings files themselves! It now looks EXACTLY as I want it to be. Yours is a good suggestion to just create a theme with the HTML content already included, but this updating system is going to be used by several clients, each with their own websites; I would have to create themes for every client's HTML layout. It will be easier to just have a "blank slate" theme for all to use, then include wherever needed.

Only one thing left now: figuring out how to have each client access only their own content. And yes, I've set permissions and it still doesn't work (I have to allow Administer nodes just for the client users to see the "Administer > Content Management > Content" drill-down, but then they can access all content. Remove the Administer nodes, and the drill-down disappears and they can't even edit existing content anymore).

Sheer stubborness has kept me this far, and I know that I will eventually find a solution. Thanks for all the suggestions.