Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Trouble with Insert/Edit Link

 

 


virgodesign
User

Mar 6, 2008, 10:21 PM

Post #1 of 8 (505 views)
Shortcut
Trouble with Insert/Edit Link Can't Post

Hello,

Sorry to bug again. When I set up a link with the "Insert/Edit Link" button it keeps changing the link to the cmsAdmin/ directory.

For example when I set the link to "page.php" it keeps resetting it to "cmsAdmin/page.php". Even if I use the Code button and change the html it still sets it back.

I assume there is a little config setting for this somewhere ?

Thanks so much,
Avrom


Dave
Staff / Moderator


Mar 7, 2008, 9:59 AM

Post #2 of 8 (500 views)
Shortcut
Re: [virgodesign] Trouble with Insert/Edit Link [In reply to] Can't Post

It's because "page.html" is a relative link. Your viewers might be in any directory so it tries to make it into an absolute link.

Is it possible to create links starting with / or http://?

There may be a setting for this that would always make it link off the root. So page.html would become /page.html

Let me know what you want to do for that.

Dave Edis - Senior Developer
interactivetools.com


virgodesign
User

Mar 7, 2008, 10:27 AM

Post #3 of 8 (498 views)
Shortcut
Re: [Dave] Trouble with Insert/Edit Link [In reply to] Can't Post

Hi Dave,

I would like to have the option of either an absolute link (http://www.somelink.com) or a relative link to the root directory only of the website (/page.html).

Thanks kindly,

Avrom


Dave
Staff / Moderator


Mar 7, 2008, 11:34 AM

Post #4 of 8 (492 views)
Shortcut
Re: [virgodesign] Trouble with Insert/Edit Link [In reply to] Can't Post

Ok, right now you should be able to enter "/page.html" or "http://www.example.com/page.html" and have it work correctly. If it doesn't let me know.

I've added some code to the wysiwyg for the next version so when you enter "page.html" it will convert it to be absolute from the root "/page.html".

I've had questions about that before so hopefully that will be a better solution than what it was doing before.

Dave Edis - Senior Developer
interactivetools.com


virgodesign
User

Mar 7, 2008, 12:19 PM

Post #5 of 8 (489 views)
Shortcut
Re: [Dave] Trouble with Insert/Edit Link [In reply to] Can't Post

Cheers Dave,

That works fine. Thank you. Hey if you have the code and you want to share, that would be awesome.

Btw,
Regarding the CMS, I figured the way you might want to display the "menu" items instead of along the menu top-bar is to display them just like you do for the Admin Section Editors.

Admin > Section Editors (that page)

I assume that would be quite easy to do from a coding view as its already setup that way in the program. If it is I would be really interested in the coding for that.

As always thank you for all your help :)

Avrom


Dave
Staff / Moderator


Mar 7, 2008, 1:23 PM

Post #6 of 8 (487 views)
Shortcut
Re: [virgodesign] Trouble with Insert/Edit Link [In reply to] Can't Post

No problem. To have relative links auto converted to absolute urls from the website root just open /lib/menus/default/edit_functions.php, search for "relative_urls" and replace that line with this:


Code
relative_urls : false, 
document_base_url: "/",


This change will be in v1.11 (the next release).

To display the menu list on the home page you could just copy some code from /lib/menus/header.php to /lib/menus/home.php. Try adding this to home.php:


Code
<?php 
require_once "lib/menus/header_functions.php";

foreach (getMenuList() as $row) {
$hasMenuAccess = @$CURRENT_USER['accessList']['all']['accessLevel'] >= 6 ||
@$CURRENT_USER['accessList'][@$row['tableName']]['accessLevel'] >= 6;
if (!$hasMenuAccess) { continue; }

print "<a href='?menu={$row['tableName']}'>" . htmlspecialchars($row['menuName']) ."</a><br/>\n";
}
?>


Let me know if that does what you need.

Dave Edis - Senior Developer
interactivetools.com


virgodesign
User

Mar 7, 2008, 2:00 PM

Post #7 of 8 (485 views)
Shortcut
Re: [Dave] Trouble with Insert/Edit Link [In reply to] Can't Post

Cheers Dude,

Is there some table and row settings that need to be defined ? since I just get a blank result for that coding...

i.e.example (not sure on actual values)

$options = array();
$options['tableName'] = $current;
$options['recordNum'] = '';
$options['where'] = '';
$record = getRecord($options);


Dave
Staff / Moderator


Mar 7, 2008, 2:22 PM

Post #8 of 8 (483 views)
Shortcut
Re: [virgodesign] Trouble with Insert/Edit Link [In reply to] Can't Post

Where did you want it displayed? I was thinking you wanted it on the homepage you see when you login to CMS Builder. That's the page that says "Welcome to CMS Builder v1.xx". If you add the code to that file (in /lib/menus/home.php) it should work.

Did you want it displayed there or somewhere else?

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4