Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
Embedded Virtual Includes in Article Pages, Embedded Forms

 

 


hollyvalero
Novice

Nov 17, 2006, 8:06 AM

Post #1 of 5 (1045 views)
Shortcut
Embedded Virtual Includes in Article Pages, Embedded Forms Can't Post

I have many sites that include email forms. Sometimes it's a small form that is embedded many times throughout a site. Historically, since forms are easy to break, I create a form snippet (emailform.shtml) and then use a virtual include in the content are of a web page. I usually don't use the WYSIWYG editor, so it's easy enough to pop in:

<!--#include virtual="/snippets/emailform.shtml"-->

The new AM2 is stripping out this stuff, and the rich editor doesn't seem to cover forms.

What's the best way to get these forms included in AM2? I've been trying to make the process as uncomplicated as possible for clients who manage their own content but don't have a lot of experience with forms.


Damon
Staff / Moderator


Nov 18, 2006, 8:55 AM

Post #2 of 5 (1031 views)
Shortcut
Re: [hollyvalero] Embedded Virtual Includes in Article Pages, Embedded Forms [In reply to] Can't Post

Hi Holly,

SSIs are stripped out of added content to prevent malicious users from using them to cause a security issue.

One way to include your SSI email form would be add it to your templates (article pages for example) and then add a Yes No dropdown option on the article edit page in Article Manager.

Users could select Yes to have the form embedded in the article. You could have the drop down default to No.

Next, in the templates you could use a tempateif statement that would only publish the SSI if the user had selected Yes.

Do you think this would work for you?

If you think it will let me know and I can go through the steps to get this set up and answer any questions you have. :)

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/


hollyvalero
Novice

Nov 18, 2006, 9:35 AM

Post #3 of 5 (1029 views)
Shortcut
Re: [Damon] Embedded Virtual Includes in Article Pages, Embedded Forms [In reply to] Can't Post

This might work okay. The other option would be, instead of a Yes/No and a TemplateIF, a drop-down menu that would allow embedding of common form items.

I'm thinking a new field in the database editor, with a "list" type that could somehow contain a variety of options like:

if option chosen =
emailform (then embed the form snippet email.shtml)
feedback form (then embed the form snippet feedback.shtml)
sign up form (then embed the form snippet signup.shtml)
none (don't embed any form)

I know how I would do this in the old article manager... but the new one I'm not quite sure.

If that's not possible, I could do the yes/no option and just add a variety of them to the template...

I assume that would be done similar to the Yes/No tweak for displaying the article summary only?


hollyvalero
Novice

Nov 18, 2006, 11:49 AM

Post #4 of 5 (1022 views)
Shortcut
Re: [Damon] Embedded Virtual Includes in Article Pages, Embedded Forms [In reply to] Can't Post

Okay, I figured it out...

I built two fields in the article database - the first an "addForm" yes or no, the second a drop down list of form choices based on the ID number of the survey (built in php)

Back in the page, I added the templateIF to display nothing if there was no request to embed the form and built the virtual include sans form ID number if the answer was yes.


Code
<!-- templateIf : $article.addForm$ eq "Yes" -->  
<!--#include virtual="/phpQ/fillsurvey.php?sid=$article.formsInclude$"-->
<!-- /templateIf -->


<!-- templateIf : $article.addForm$ ne "Yes" -->

<!-- /templateIf -->


This seems to have done the trick quite nicely. Now I just have to figure out RSS by category.

H


Damon
Staff / Moderator


Nov 18, 2006, 12:48 PM

Post #5 of 5 (1020 views)
Shortcut
Re: [hollyvalero] Embedded Virtual Includes in Article Pages, Embedded Forms [In reply to] Can't Post

Hi Holly,

>Now I just have to figure out RSS by category.

I wrote a tutorial to create RSS feeds for each category. Take a look a the Tutorial index page for other useful tips and how-tos.

Also, with your templateif statement, you don't need the second empty statement. If Yes isn't selected, the the SSI (which is inside the opening and closing templateif) won't be published.

So just this is all you need:
<!-- templateIf : $article.addForm$ eq "Yes" -->
<!--#include virtual="/phpQ/fillsurvey.php?sid=$article.formsInclude$"-->
<!-- /templateIf -->

Hope that helps. :)

--------------------------------------------------- 
Cheers
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/