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

Home: Products: CMS Builder:
View Website

 

 


Djulia
User

Dec 22, 2007, 8:23 AM

Post #1 of 20 (1079 views)
Shortcut
View Website Can't Post

Hi,

I would like to obtain a specific value for : View Website >>

For example :

I have an editor (1) who has access to the folder News and another editor (2) which has access to folder FAQ.

It would be possible to give a different value for each editor?

Editor (1) : View Website >> == News
Editor (2) : View Website >> == FAQ

Thank you for your answer.

Djulia


Dave
Staff / Moderator


Dec 22, 2007, 9:13 AM

Post #2 of 20 (1076 views)
Shortcut
Re: [Djulia] View Website [In reply to] Can't Post

No, it's not possible to have it link to different urls depending on which user is logged in.

A few options for you though. The simplest might be to create a publishedSections.html page with links to all the published sections. Then have the "view website" link point to that. That way all the CMS users could find their section.

The other would be the hack the /lib/menus/header.php file to show a different link based on the user. I could write some quick custom code up for you to do that if you wanted. But you'd have to re-apply it every time you upgraded or it would get overwritten.

Does either of those work for you? I think the first one would be the easiest, especially if you ever have a user who manages 2 sections.

Hope that helps! :)

Dave Edis - Senior Developer
interactivetools.com


Djulia
User

Dec 22, 2007, 9:24 AM

Post #3 of 20 (1074 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

Hi Dave,

Thank you for your answer.

And with a condition ?

For example :

<?php if editor == 'name2' ?>
url 1
<?php elseif editor == 'name2' ?>
url 2
<?php endif ?>

Thank,

Djulia


Dave
Staff / Moderator


Dec 22, 2007, 10:04 AM

Post #4 of 20 (1070 views)
Shortcut
Re: [Djulia] View Website [In reply to] Can't Post

If you are comfortable modifying the code, here's how:

- open /lib/menus/header.php
- search for $SETTINGS['websiteUrl'] and replace with $viewUrl
- add this code somewhere above it:


Code
<?php 
$viewUrl = $SETTINGS['websiteUrl'];
$username = $CURRENT_USER['username'];
if ($username == 'admin') { $viewUrl = "http://www.google.com/"; }
if ($username == 'dave') { $viewUrl = "http://www.yahoo.com/"; }
?>


Let me know if that works for you. :)

Edit: Fixed code (added $ in front of username)

Dave Edis - Senior Developer
interactivetools.com


(This post was edited by Dave on Dec 22, 2007, 10:43 AM)


Djulia
User

Dec 22, 2007, 10:06 AM

Post #5 of 20 (1070 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

Hi Dave,

I tested :

<?php if ($CURRENT_USER['isMyname']): ?>
My url
<?php endif ?>

...but, that does not function. :(

Djulia


Djulia
User

Dec 22, 2007, 10:14 AM

Post #6 of 20 (1069 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

Hi Dave

I have just tested your proposal, but I have the error :
Notice: Use of undefined constant username - assumed 'username' in ...

An idea ?

Thank you,

Djulia


Dave
Staff / Moderator


Dec 22, 2007, 10:42 AM

Post #7 of 20 (1066 views)
Shortcut
Re: [Djulia] View Website [In reply to] Can't Post

Ahh, I forgot the $ in front of 'username'. Sorry about that. Try this:


Code
<?php  
$viewUrl = $SETTINGS['websiteUrl'];
$username = $CURRENT_USER['username'];
if ($username == 'admin') { $viewUrl = "http://www.google.com/"; }
if ($username == 'dave') { $viewUrl = "http://www.yahoo.com/"; }
?>


Dave Edis - Senior Developer
interactivetools.com


Djulia
User

Dec 22, 2007, 10:52 AM

Post #8 of 20 (1063 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

Hi Dave

It is perfect !!! Smile

Thank you,

Djulia


Djulia
User

Jul 10, 2008, 5:08 AM

Post #9 of 20 (531 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

Hi Dave,

I have a suggestion.

It would be possible to add a field "View Site" (websiteUrl) in the section User Accounts ?

It would be then possible to use a condition in header.php :

<?php if ($CURRENT_USER['websiteUrl']): ?>
<a href="<?php echo $CURRENT_USER['websiteUrl'] ?>"><?php _e('View Website &gt;&gt;') ?></a>
<?php elseif ($SETTINGS['websiteUrl']): ?>
<a href="<?php echo $SETTINGS['websiteUrl'] ?>"><?php _e('View Website &gt;&gt;') ?></a>
<?php endif ?>


Thank you for your answer.

Djulia


kevbarker
User

Jul 10, 2008, 9:27 AM

Post #10 of 20 (521 views)
Shortcut
Re: [Djulia] View Website [In reply to] Can't Post

What I would like to be able to do is to have the 'View Site' be linked to the current page you are editing. That way when you click on it you can verify the changes/updates you just made to that section. Is that possible?

Thanks,

Kevin


InHouse
User

Jul 10, 2008, 11:28 AM

Post #11 of 20 (515 views)
Shortcut
Re: [kevbarker] View Website [In reply to] Can't Post

Since it's come up...
I regularly alter the code to add a 'View Editors' link to the blue header bar in the backend. I tie it into the section which only shows up for the Admins. Saves me oodles of extra clicks during development and testing.
J.


Donna
Staff / Moderator


Jul 10, 2008, 1:24 PM

Post #12 of 20 (500 views)
Shortcut
Re: [kevbarker] View Website [In reply to] Can't Post

Hey Kevin,

The main reason this isn't really possible is because CMS Builder can't really know what page you're actually editing... in fact, the content you're updating could be on any number of different pages.

This is why the "View Site" is linked to whatever URL you set in the server options -- because without telling it explicitly what URL you want there, CMS Builder can't know where you want it to be.

I hope this helps. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


Dave
Staff / Moderator


Jul 10, 2008, 6:44 PM

Post #13 of 20 (482 views)
Shortcut
Re: [InHouse] View Website [In reply to] Can't Post

So what if we had the following:

On the record list page: A "View section >>" link that went to the "List Page Url" defined under Section editors.

On the record modify we have a "View Page >>" link that went to the "Detail Page Url" defined under Section editors.

The on the record create page we could have that link grayed out since there's no public link yet.

Would that work for everyone?

Dave Edis - Senior Developer
interactivetools.com


Djulia
User

Jul 11, 2008, 2:44 AM

Post #14 of 20 (475 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

It is an good idea!

You can indicate the implementation ?

Thanks,

Djulia


kevbarker
User

Jul 11, 2008, 4:15 AM

Post #15 of 20 (465 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

That would be great. That's what I was looking for. I also understand Donna's point about the fact that the records could go anywhere, but if we could define the link as you have mentioned that would work great.

Thanks Dave!


Dave
Staff / Moderator


Jul 14, 2008, 8:03 AM

Post #16 of 20 (389 views)
Shortcut
Re: [Djulia] View Website [In reply to] Can't Post

I've added a "Preview" button to the record list page. You need to have "List Page Url" defined under section editors for it to appear.

This will be in 1.20, I've attached the latest list.php.

Back up your existing /lib/menus/default/list.php and then replace it with the attached file (Make sure you're running 1.19 first!)

I'm going to give some more though to how to best do the record previews.

Dave Edis - Senior Developer
interactivetools.com


(This post was edited by Dave on Jul 14, 2008, 10:15 AM)
Attachments: list.php (5.70 KB)


Djulia
User

Jul 14, 2008, 11:24 AM

Post #17 of 20 (364 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

Hi Dave,

That functions perfectly. Smile

It will be possible to apply this for "View Website >>" in header.php ?

Thank you for your answer.

Djulia


(This post was edited by Djulia on Jul 14, 2008, 11:25 AM)


Dave
Staff / Moderator


Jul 14, 2008, 2:05 PM

Post #18 of 20 (349 views)
Shortcut
Re: [Djulia] View Website [In reply to] Can't Post

Yes, you can use the schema _listPage value for this:


Code
<?php if (@$schema['_listPage']): ?> 
<a href="<?php echo @$schema['_listPage'] ?>"> ... </a>
<?php else: ?>
<a href="<?php echo $SETTINGS['websiteUrl'] ?>">...</a>
<?php endif ?>


Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


gkornbluth
User

Jul 14, 2008, 3:01 PM

Post #19 of 20 (345 views)
Shortcut
Re: [Dave] View Website [In reply to] Can't Post

Dave,

I'm really glad that you're dealing with this whole view/preview issue.

Just to add my 2 cents, again...

I think that it's extremely important to be able to preview/approve materials before they go "live" and replace the existing materials.

A) In case trhe material is not for public consumption at the time it's being created and will ultimately be hidden until a launch date.

B) The person who is entering the information really screws it up and needs to fix it BEFORE the old information is off the live site and gone forever.

C) In many companies there's a hierarchy of approval that must be adhered to before information is released to the public.

I think that the implications of these types of issues could be real "deal breakers" for potential customers, and possible job security and legal challenges for those in the IT development chain.

Please give some thought to these "end user" issues during your near term revisions.

Thanks

Jerry


Dave
Staff / Moderator


Jul 14, 2008, 3:13 PM

Post #20 of 20 (343 views)
Shortcut
Re: [gkornbluth] View Website [In reply to] Can't Post

Hi Jerry,

There's some support for this with the following features:

Special checkbox field "hidden" - you can create this field to hide a record. You can set it to be an admin only field to only admins and section "managers" can make a record live.

Having regular users who can create articles but not make them live, then a section manager or admin user who marked a record as live, then changing the owner (Created By) is one way to implement an approval process and prevent further changes by the user.

There's also fields for publishDate, removeDate, and neverRemove to have records go live and be removed on specific dates. You can read more about special fieldnames here:
http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html

These are pretty basic as far as "hierarchy of approval" features though. Those types of features would require a major overhaul and advances to how the user accounts work, records are stored, as well as new features to enable users to compare changes between new and changed records, approve them, rollback, etc.

And there's certainly different views on whether advanced approval hierarchy processes are even the best way to deal with the issue.

That said, we'll certainly continue to add incremental features and if someone was interested in having this done as a custom job I'd be happy to talk to you about it. Feel free to email me at dave@interactivetools.com

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
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