0

Is it possible to get page content (in array) from for example a Title. Like this;

$wantedPage = function_to_get_page_content('This is the title');

and then just print_r($wantedPage) to get this page content, in array.

I'm pretty new on this great CMS-system..

0

If what you mean is the node contents, in D6, this would be as easy as $node = node_load(array('title' => $text)); and I would hope the same holds true it D7, but I've been known to misspeak a bit there :) Just realize that titles aren't necessarily unique. If you mean the page, with all the header, footer, css, js, blocks and so forth, that's another story in of itself.

  • Well, I know that would be a problem, but is it possible to also add the content-type in some how, because Swans has the content-type "subfamily" and Mute Swan has the "specie" content-type? – Max Allan Feb 12 '12 at 19:13
  • node_load(array('title' => $text, 'type' => $type)); – Jimajamma Feb 12 '12 at 19:15
  • Found the solution... $items = entity_load('node', FALSE, array('type' => 'mytype', 'title' => $text)); is the right in D7. – Max Allan Feb 13 '12 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.