including a page

JohnNoc-old - January 22, 2007 - 07:06
Project:Rep[lacement]Tags
Version:5.x-1.1
Component:.tags Modules
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Having a replacement tag for the php snippet on adding any existing page/path would be very useful to many, I think.... including me :-)

example...
tag:
{INCLUDE_PATH:aggregator/categories/1}

and will be replaced by php snippet:

<?php
$q
= $_GET['q'];
$_GET['q'] = drupal_get_normal_path('aggregator/categories/1');
print
menu_execute_active_handler();
$_GET['q'] = $q;
?>

I have tried to add it in the custom SiteWide - Rep[lacement]Tags with no success. I guess a php code on the text-area isn't supported :-(

Maybe adding it on the system.tags?

Thanks.

#1

profix898 - January 22, 2007 - 15:27

I have tried to add it in the custom SiteWide - Rep[lacement]Tags with no success. I guess a php code on the text-area isn't supported :-(

Yes, its intented to disallow php in table reptags: 1. to keep the code easy and fast and 2. - most important - for security reasons. If this was possible every user with 'manage user/sidewide reptags' could embed 'potentially' bad code into the pages. Thats what the .tags modules are for - to provide more complex replacement tags. Table reptags are just for textual replacements.

Maybe adding it on the system.tags?

What you suggest is advanced functionality IMO and I dont think I will add such code to system.tags.

replacement tag for ... adding any existing page/path

Can you explain what you need this for? Sounds like you want something similar to the panels module (http://drupal.org/project/panels)? I'm not certain many people will need to embed whole pages into their nodes!? But if you want to create or help with an 'embed.tags' module (or similar) I will be happy to commit this. But ...

  1. to embed nodes you should use node_xxx (load/view) directly to reduce the overhead of the menu system (other pathes are just fine, although it somehow looks like a hack to me)
  2. this only makes sense if you want to embed multiple pages/pathes (otherwise you would simply browser to the page/path, not?). But embedding multiple objects would require some basic css to be integrated in the .tags module.
  3. in your example you are trying to embed an aggregator path. Can't you get the same result by using the block.tags module and creating an appropriate block?

Regards Thilo

#2

JohnNoc-old - January 22, 2007 - 20:28

Thanks for the reply.

But if you want to create or help with an 'embed.tags' module (or similar) I will be happy to commit this.

Hmmm....if I only can!!! My coding prowess is in the analyze other codes--copy--paste--hack--crossfingers--try stage still. I tried coding this embed thing before submitting the request but i'm still php coding challenged. :-( But surely, if i get successful on this embed.tags, you're the first to know! :-)

Can you explain what you need this for? Sounds like you want something similar to the panels module...

Well....the panels module is an alternative, yes. But some pages are still not incorporated with the panels module and a user still has to hardcode the snippet aforementioned in a custom content on a panels region.

Usage example?

  • Custom 404 page. After the typical file not found message, embed 'search/node' with leading text: "To find what you're looking for, may we suggest you use our search form below". Then embed a views-generated page with leading text: "We also recommend the following:"
  • A custom index page of a taxonomy term where there's an article on the term first and then including the 'taxonomy/term/tid' page and embedding related news with teasers and a "blog it" link
  • etc.

But embedding multiple objects would require some basic css to be integrated in the .tags module.

hmmm...what about the site owner creating a new content type where the site owner creates reuseable content or features. With an embed.tag, site users can reuse those content into their custom pages.

embed an aggregator path...Can't you get the same result by using the block.tags module

Not if the site owner wants more than just the headlines

you can take a peek at a custom 404 page on this site http://www.norgesportal.no/drupaldrupaldrupal (note:site is still under development)
This was achieved with regions and embedding a page's content in a custom block. But after wanting to embed numerous pages as well as news pages on their related taxo term and other pages, the admin/build/block page is too long already due to numerous auto-module blocks like categories, aggreg., tagadelic, etc. Besides, creating a block with the php embed snippet then using the blocks.tags to embed them on a new node is a longer route and defeats the purpose of Rep[lacement]Tags' control and ease of use.

hmmmm...this is a long post :-) thanks for the patience!

 
 

Drupal is a registered trademark of Dries Buytaert.