Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 03:24:49 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155366 Posts in 21695 Topics by 7729 Members
Latest Member: piset
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Admin > Modify Page > Section Block Labels  (Read 790 times)
redfus

Offline Offline

Posts: 5


« on: June 18, 2008, 08:07:17 PM »

Hi Everyone,

The majority of templates on my site use multiple content blocks. When editing pages in the admin area this becomes quite confusing for the author as there is no way for them to identify which block corresponds to which area on the page.

Is it possible to display above each WYS editor the name of the block it corresponds to (when in admin area), possibly by loading the block title from the info.php file?

Many thanks,
Redfus
Logged
doc
Guest
« Reply #1 on: June 18, 2008, 08:15:37 PM »

Hello,

with some knowledge of PHP, this can be achieved by modifying WB core files. There is no option you can turn on from the WB backend.

Christian
Logged
redfus

Offline Offline

Posts: 5


« Reply #2 on: June 18, 2008, 09:07:43 PM »

Hi Chris,

I thought as much - that sounds fine, always happy to get stuck into the PHP. Does anyone have any pointers on where to start, save me hunting through all of the core files?

Cheers,
Redfus
Logged
doc
Guest
« Reply #3 on: June 18, 2008, 09:12:59 PM »

Hello,

have done something for a customer some time ago. The file to look at is located in /admin/pages/modify.php. You need to add an additional database query to get the template directory assigned to the current displayed page, include the info.php file of the template and output the results.

Also have a look to /admin/pages/sections.php which shows an implementation.

If I find the modified file, I will attach it here for download.

Regards Christian
Logged
redfus

Offline Offline

Posts: 5


« Reply #4 on: June 18, 2008, 09:14:41 PM »

Hi Christian,

I would very much appreciate that if you can find the file. In the meantime I shall do my best and post any code that works.

Cheers,
Sam
Logged
redfus

Offline Offline

Posts: 5


« Reply #5 on: June 18, 2008, 09:25:59 PM »

Starting to struggle with this one, I've only being using website baker for a little while and need to get my head around how the core works!

For anyone else following this thread, the particular area of code is here:

Code:
// Get sections for this page
$module_permissions = $_SESSION['MODULE_PERMISSIONS'];
$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
if($query_sections->numRows() > 0) {
    while($section = $query_sections->fetchRow()) {
        $section_id = $section['section_id'];
        $module = $section['module'];
        //Have permission?
        if(!is_numeric(array_search($module, $module_permissions))) {
            // Include the modules editing script if it exists
            if(file_exists(WB_PATH.'/modules/'.$module.'/modify.php')) {
                echo '<a name="'.$section_id.'"></a>';
                require(WB_PATH.'/modules/'.$module.'/modify.php');
            }
        }
    }
}
Logged
doc
Guest
« Reply #6 on: June 18, 2008, 09:27:02 PM »

Hello,

luckily it was easy to find.

Download the attached file, rename it modify.php and upload it via FTP to /admin/pages/modify.php. Please create a backup of the original modify.php file (e.g. rename it it modify.php.org). Then clear browser cache and give it a try.

Feedback welcome, maybe we can add this to a possible next minor release.

Regards Christian

[Edit:] Added changes to SVN Changeset 846.
« Last Edit: June 22, 2008, 07:01:21 AM by doc » Logged
redfus

Offline Offline

Posts: 5


« Reply #7 on: June 18, 2008, 09:43:16 PM »

Hi Christian,

This is exactly what I was trying to achieve - thank you very much for digging that file out for me! Very much appreciated.

I agree, it would be useful (even with only one block) for clarification purposes.

Thanks once again,
Redfus
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!