 | |  |
 |

frugally4u
New User
Feb 20, 2007, 7:59 AM
Post #1 of 2
(182 views)
Shortcut
|
|
Help with SSI inside of WYSIWYG Article editor
|
Can't Post
|
|
I am trying to use a SSI inside of my articles. My pages end in .shtml Here is an example of one of my SSI: <!--#include virtual="/includes/336ads.txt"--> 1. Here is the error I get from the finished article: undefined undefined 2. Here is what the code looks like in the html of the editor: undefined<!-- undefined#include virtual="/includes/336ads.txt"undefined--> undefined 3. I have tried changing the options to: Server Resolved - supports SSIs and server side code (recommended) (this didn't help - so I'm sure it wasn't the answer :) 4. I tried adding the include as a placeholder - but the placeholder simply showed up as actual text in the published article. I want the include to be used for adsense. I can include the actual code within the article, but I want to have greater control over changing the colors & such should I need to in the future. I would think that there is a way to use SSI inside of the article itself? Thanks! Pearl
|
|
|  |
 |

Donna
Staff
/ Moderator

Feb 20, 2007, 1:57 PM
Post #2 of 2
(174 views)
Shortcut
|
|
Re: [frugally4u] Help with SSI inside of WYSIWYG Article editor
[In reply to]
|
Can't Post
|
|
Hi Pearl! For security reasons, Article Manager doesn't allow SSI's... that's a really good way to have malicious things happen on your server. :) There are ways around it, but they would involve modifying some of the modules directly -- we generally don't recommend doing this either unless you really know what you're doing. So, instead, I think a better method would be to create specific fields for your ads. What you'll do is first go into Admin -> Database Editor, then edit the Articles table. Click "Add Field" at the bottom of the page, and give it a Label (so you know what to do with it) and a Name (which will also be the placeholder -- for this example, I'll just call it "adsense"). Under Field Type, choose text field. Feel free to muck about with the rest of the settings, but the defaults should work fine. Now, when you create a new article, you'll have a new text field. (If you want multiple ads, you can add multiple fields, but let's start with one for now.) When creating articles, enter in just the filename you want. In this case, 336ads.txt Now, you'll need to add the code to your template to have these fields show up. The placeholder will be (if you used the field name I mentioned above) $article.adsense$ -- this will work like any regular placeholder. What you'll want to do is setup a templateIf, so that it only appears if there's something in the field. It'll look like this:
<!-- templateIf : $article.adsense$ ne "" --> <!--#include virtual="/includes/$article.adsense$" --> <!-- /templateIf --> Would something like that work for you? 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.
|
|
|  |
 | |  |
|