I am banging my head against wall for days, what is with this module that you dont have this option?
Everybody would probably want to display some text or html code in the popup??

Or is there a way to do this?

I would like to have only few paragraphs of text and image displayed in overlay, without the top menu, links, sidebars....

is this possible ????

Comments

miteshmap’s picture

Hi,

When you are using overlay. it will be considered as admin pages so, normal menu, sidebar used for frontend will not be displayed.

function mymodule_admin_paths_alter(&$paths) {
  $path['node/*/view'] = TRUE;
}

There are some available modules by using those modules you can display content in the overlay.
http://drupal.org/project/overlay_paths
http://drupal.org/project/ctools_automodal

thaistore’s picture

i checked both modules no documentation how to do it for god sake

miteshmap’s picture

For overlay_path you can use

function modulename_overlay_paths() {
    $paths = array('contact' => TRUE,);
    return $paths;
}

and for ctools_automodal as given on the module page

<?php
function mymodule_menu() {
  $items['mymodule/form'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array('mymodule_form'),
    'access arguments' => array('administer mymodule'),
    'modal' => TRUE, // This line is where the magic happens.
  );
}
?>

just add 'modal' => true at the end of the item declaration

thaistore’s picture

ok I want to use overlay paths

function modulename_overlay_paths() {
    $paths = array('contact' => TRUE,);
    return $paths;
}

where exactly to put this code?

And how to make a link and embed text in the overlay?
DO I have to embed node or am I able to embed like a cluster of html with text and few images?

Can you show me exactly how to use make a link?

miteshmap’s picture

If you have a particular node then you just need to create a custom module. or if you have any custom module you can use that. then just need to define the path as i mentioned.

function modulename_overlay_paths() {
    $paths = array('node/5' => TRUE,);  // node/$nid =>  $nid can  be any node id.
    return $paths;
}
thaistore’s picture

so i can create new module and delete the code and replace it with this code? Do you perhaps know which module i can use and strip out the code? Or just add this code to any module I have enabled?

function modulename_overlay_paths() {
    $paths = array('node/5' => TRUE,);  // node/$nid =>  $nid can  be any node id.
    return $paths;
}

for each node that i want it to pop up?

So everytime i link to node/5 it will open in overlay?

I need to make same code for each node right? Or can I use it like this?

function modulename_overlay_paths() {
    $paths = array('node/5' => TRUE,);  // node/$nid =>  $nid can  be any node id.
$paths = array('node/6' => TRUE,);  // node/$nid =>  $nid can  be any node id.
$paths = array('node/15' => TRUE,);  // node/$nid =>  $nid can  be any node id.
    return $paths;
}

Is that correct?

miteshmap’s picture

No for your code you need to use this code.

function modulename_overlay_paths() {
    $paths = array('node/5' => TRUE,
                         'node/6' => TRUE,
                         'node/15' => TRUE);  
    return $paths;
}
thaistore’s picture

can i just attach this code to any other module? will it work?

if not what is the easiest way to create module

miteshmap’s picture

yes can attache this code to any module but just remember to replace "modulename" to original modulename...

lsolesen’s picture

Status: Active » Closed (fixed)

Marking as fixed as there is an accepted answer.