close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Power Gallery Comments Out in Power CMS?

Thread began 4/09/2012 8:03 pm by cldsk | Last modified 1/14/2014 9:04 am by Jason Byrnes | 6049 views | 18 replies |

cldsk

Power Gallery Comments Out in Power CMS?

Hello, this is the first problem I have had with Power Gallery as I have used it with a few sites so far and have been pleased. It seems that once I paste it into the source code in a Power CMS page that it gets "commented out" and therefore does not display.

I paste this:

<?php
$pg_id = '1';
$pg_theme = 'DLM';
include('/homepages/40/d369590415/htdocs/divineloveministries/gallery/galleries/flow/index.php');
?>

after updating the page, and going back to the code, I get this:

<!--?php
$pg_id = '1';
$pg_theme = 'DLM';
include('/homepages/40/d369590415/htdocs/divineloveministries/gallery/galleries/flow/index.php');
?-->


even if I delete the !-- and -- when I hit update it automatically goes back in. Can you tell me what I might be doing wrong?

Thanks so much!
~Chris

Sign in to reply to this post

Jason ByrnesWebAssist

to add a gallery to Power CMS, you'll need to convert the add to site code for the gallery:

to a hidden form element:

<input type="hidden" name="powergallery" id="1" theme="DLM" value="/homepages/40/d369590415/htdocs/divineloveministries/gallery/galleries/flow/index.php" />




you will also need to edit the Power CMS Developer Notes code to use the wa_evaluate() function.

for example, the developer notes code may look like this:

php:
<?php

include('/Applications/MAMP/htdocs/pcms_211/WA_CMS/addtosite.php');
echo 
WA_getCMSContent($database_PowerCMSConnection$PowerCMSConnection'Content Group''ContentArea'false);
?>




you would need to change it to this:

php:
<?php

include('/Applications/MAMP/htdocs/pcms_211/WA_CMS/addtosite.php');
echo 
wa_evaluate(WA_getCMSContent($database_PowerCMSConnection$PowerCMSConnection'Content Group''ContentArea'false));
?>



Note: there is a bug we are aware of when using a gallery on a power CMS page. the issue is that Power CMS uses a variable for the solution path with the same name as the one for Power gallery. the fix is to add code to the admin_gallery/common/functions.php file, however the code is based on the names of the folders you installed Power CMS and Power Gallery to.

as an example, I have Power CMS installed to a folder named "pcms" and Power Gallery to a folder named "pg2"
in the admin_gallery/common/functions.php, i would add the following code at line 2:

php:
$GLOBALS['absLink'] = str_replace("/pcms", "/pg2", $GLOBALS['absLink']);
Sign in to reply to this post

cldsk

Sorry for my delay in responding to this....I am a little confused in all this extra coding need to make Power Gallery to work with PowerCMS...how am I able to get it to work for a client who wants to use Power Gallery to create new Galleries and drop them into the PowerCMS if they don't know or have access to all the coding?? This seems like a bit of false advertising as Power Gallery advertises a simple PHP code for the gallery creation and PowerCMS advertises the source feature to embed code/etc...is there a way to make this work for the client so that it works as advertised? By what you are proposing, it is easier for me to drop the Gallery php code into the actually php page, but for new galleries the client wants to make, this would be impractical, at least using this product?

Sign in to reply to this post

Jason ByrnesWebAssist

the only coding change the client would need to perform on adding the gallery would be to modify the gallery PHP code to a hidden element.


all of the other changes are changes you would need to make to the pages that display the Power CMS Content.


the 2nd, 3rd and forth code blocks are changes that need to be made to the Power CMS System to allow a gallery to be added.

once those changes are made, the client can add a gallery to the CMS by changing the php code for the gallery:

php:
<?php

$pg_id 
'1';
$pg_theme 'DLM';
include(
'/homepages/40/d369590415/htdocs/divineloveministries/gallery/galleries/flow/index.php');
?>




to a hidden element:

php:
<input type="hidden" name="powergallery" id="1" theme="DLM" value="/homepages/40/d369590415/htdocs/divineloveministries/gallery/galleries/flow/index.php" />




the format of the hidden element is:
name="powergallery" - this wont change.
id="1" - this takes the value of the $pg_id variable "$pg_id = '1';"
theme="DLM" - this takes the value of the $pg_theme variable "$pg_theme = 'DLM';"
value="/homepages/40/d369590415/htdocs/divineloveministries/gallery/galleries/flow/index.php" - this takes the value of the include.

Sign in to reply to this post

YellowCircleWeb

I have this problem too - need further help

Hi,

I'm having the exact same issue here, but I don't completely understand how to use your workaround Jason.

You say: "the only coding change the client would need to perform on adding the gallery would be to modify the gallery PHP code to a hidden element.


all of the other changes are changes you would need to make to the pages that display the Power CMS Content." - where do I make these changes exactly? Power Gallery automatically creates the code to insert a gallery into a page, I don't want to manually have to go into each gallery a client creates and have to convert the code and then try and instruct them how to convert it to a hidden field in Power CMS. I think we need a fix for this ASAP. A lot of clients are not technical at all - just copying the code from Power Gallery can prove challenging.

Are you able to supply fix files we can just upload to our PowerGallery installations to get them to work properly with Power CMS?

Sign in to reply to this post

Jason ByrnesWebAssist

i can give an updated copy of the galery_admin/addtosite.php page that will generate the form for the client, but the other changes you will need to make.

Attached Files
addtosite.php.zip
Sign in to reply to this post

YellowCircleWeb

Thank you for the updated file Jason. There is just one last thing I'm not quite clear on - you said in a previous reply: "you will also need to edit the Power CMS Developer Notes code to use the wa_evaluate() function." and then posted the code itself, but which file do I make this code change in, in order to get it to work for my client in PowerGallery.

Apologies if I'm being a bit slow here and missing something obvious.

Sign in to reply to this post

Jason ByrnesWebAssist

  but which file do I make this code change in  



what ever file the content area is being added to.

to add a content area to a page, you add the developer notes code to it where the content area should be displayed.

you need to edit that developer notes code to use the wa_evaluate() function

Sign in to reply to this post

YellowCircleWeb

Thanks - got yer

Sign in to reply to this post

David in Mississippi

Still Confusing - Where Are The Instructions?

Thanks for posting this, it's definitely a step in the right direction. However, the complexity of it still makes my eyes cross. Is there a single How-To page where we can get step-by-step instructions on how to set up a client's CMS page so they can add and manage their own image gallery? The points made in other posts here are valid for me as well - our clients are experts in their businesses, but not in web coding. It needs to be simple and idiot-proof so our clients don't feel overwhelmed when they want to add images/galleries to their CMS pages. Thanks.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...