This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Specific blocks only view to authenticated user

I need to show blocks only to login user. I added block from administer/blocks and want to show this block only to login users How it can be possible.

pages within pages - possible solution for tabular layout requirement

I have a client who wants a slightly complex multi-table layout for some of the content on their site. I have come up with a solution which I thought I would share, along with some alternatives that I considered...

They want their pages to be arranged something like this, where A,B,C,D,E and F are all user editable content areas:

+-----------------------+
| Std Header            |
+-----------------------+
| +---+  +---+  +---+   |
| | A |  | B |  | C |   |
| +---+  +---+  +---+   |
|                       |
| +---+  +---+  +---+   |
| | D |  | E |  | F |   |
| +---+  +---+  +---+   |
|                       |
+-----------------------+

You can obviously achieve this by including HTML "< table >" tags within a single page node. However, the problem with that is that the content editors don't like editing HTML. There is also a high risk that they would mess up the layout by accidentally deleteing some of the tags! In the past I have set up the TinyMCE "WYSIWYG" editor, but they do nasty things like cut & paste from word documents, which then includes lots of nasty MS Word formatting tags which are a pain to clean up. This approach also has the disadvantage that the page structure is then mixed with the content, which is bad practice. If they want to change the structure in future then every page will need to be re-edited. Yawn!

The second approach that I considered was something like the dashboard module. It works almost exactly the way that I would want, but unfortunately seems restricted to a fixed "header, footer and two columns" layout.

A third approach was to use the wonderful new "views" and "insert_view" modules. The idea would be to create a view onto a single page's content, then create a page which made multiple calls to "insert_view" to place the various content sections within the required table/div structure. Each box in the desired layout would thus come from a single (user editable) plain text "content" page, and all the formatting and "insert views" calls would be on a "structure" page that only I would edit. Unfortunately there currently seems to be a critical bug in the v4.7 insert_view module.

A fourth approach might be to write a custom module based on the "dashboard" module, and do some themeing to get the desired layout. That might be the most flexible way, but it seems like a lot of work, and I'm a bit lazy....

... so I came up with my alternative: use some php code to achieve pretty much the same thing as the "insert_view" approach would have done, ie "multiple content pages within a structure page".

Here's the php code. You can include it directly within the "structure" page, or in some php file that gets loaded by Drupal. I stuck it at the end of the dashboard.module file, but like I said, I'm a bit lazy! ;-)

<?php
function page_within_page($nid) {
global $user;

// fetch the body content for the requested page
$sql = "SELECT r.body, r.format FROM {node} n, {node_revisions} r WHERE r.vid = n.vid AND n.nid = '%d'";
$row = db_fetch_object(db_query($sql,$nid));
$html = check_markup($row->body, $row->format, false);

// show a handy "click to edit" link for certain users only
if (($user->uid == 1) || ($user->uid == 2)) {
$html .= '

click to edit

blocks should not view to authenticated users

blocks should not view to authenticated users

Where's Gallery in Image Module in 4.7?

Quick question: does the gallery functionality exist for the image module in 4.7?

Documentation kinda hints that it exists, and a lot of image module support issues discuss the gallery, but I've been unable to uncover the functionality.

Any help would be appreciated. Thanks

theming a 4.7 form in a table???

Hey all, I'm having some problems displaying a form in a table... I've searched the forum but didn't find
something that could really help me out.

The code is contained within a module called top_menu.module which displays a form with a select drop down
item and a submit button (when I select a certain category in the drop down and click submit, I get redirected to
the category's page)

My form code is.. In this code I've tried using the #prefix and #suffix fields for the form items.. But I dont get
a lot of control in the way I can costumize the layout..

Can anyone give me a quick snippet of how I can do this more neatly ?? or any advice/ suggestions?? Would I need to
implement my own theme_myform($form) {...} function??
thanks in advance.. here is my code:

<?php
function top_menu_form($edit = null) {

$categories = top_menu_categories();

$form['category'] = array('#type' => 'select', '#title' => t('Our Categories'),'#required' => FALSE,
'#default_value' => '', '#options' => $categories, '#weight' => 1,
'#prefix' => '

' );

$form['submit'] = array('#type' => 'submit', '#value' => t('View Category'), '#submit' => TRUE,
'#weight' => 3, '#prefix' => '

', '#suffix' => ' ', '#suffix' => '

' );

Aggregator2

I just noticed that there was a new version of Aggregator2 released & was wondering how one could upgrade their current Agg2 module.
Download latest release (cvs, 20/07/2006 - 04:31, 36.94 KB)
sorry if this seems like an ignorant question, but there doesn't seem to be anything in the documentation or forums discussing this.
cheers,
c

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions