15 Replies Latest reply on Aug 2, 2006 10:52 AM by SpaGeek

    server side include syntax

    SpaGeek

      This should be simple but I cannot figure it out. I use Dreamweaver to make multi-line global substitutions when maintaining a large online troubleshooting guide because RoboHelp cannot do this very well. And I need to use a separate file to allow or deny access to menus located within this file based on what user type accesses the help system.

      What is required syntax to use a simple server side include statement in the true code? I've tried the usual syntax of <!-- #include file="path/filename" --> (whose syntax works fine in Dreamweaver) but when RoboHelp opens the file, all heck breaks loose. Here the <h1> tag just before it loses its closing tag and as a result the included file does not work.

      So in Dreamweaver the two lines read:
      <h1>Title</h1>
      <!-- #include file="path/filename" -->

      And when opening this file in Robohelp the two lines are massaged to be:
      <h1>Title<!-- #include file="path/filename" -->

      What happened? Is this a bug?
        • 1. Re: server side include syntax
          Captiv8r Adobe Community Professional & MVP
          Hi SpaGeek

          Did you see this happen when you compiled/generated or when you opened the topic for editing in the RoboHelp WYSIWYG editor?

          I'm going to say it's not a bug, only that RoboHelp was never intended to work this way. Does this "include" thing work generically on a server or is it something unique and specific to Dreamweaver? I ask because I know Microsoft FrontPage has similar things that only work once on the server, because of the FrontPage Extensions.

          Cheers... Rick
          • 2. Re: server side include syntax
            SpaGeek Level 1
            This occurs during a simple launching of the application, not after generating. In fact, if you do this manually from the True Code mode, then to WYSIWYG, the back to True Code, it does this massaging before your eyes.

            BTW, I'm running XP SP2, RH Office X5 .0.2
            • 3. Re: server side include syntax
              MergeThis Level 4
              Have you tried saving your changes before you exit True Code?
              • 4. Re: server side include syntax
                SpaGeek Level 1
                No I have not. However, this may be a more complicated issue than just what I have described. In testing this in other parts of the same document, the strange massaging of the code does not occur. This particluar heading - where the deletion of the closing tag occurs - is inside of a multi-table structure. When I attempt to do this elselwere in the document outside of the tables, the end tag is not deleted. The include file is still not inserted but the atypical code-massaging behaviour does not appear. Let's put this aside for a moment and ask a better question.

                Server side includes are commonly used to manage menus across web pages and since this is a troubleshooting tree that serves multiple audiences, I thought that it would be a logical choice in managing this particluar help system. The better question may be, "Is there something else RH already does well that I should use instead?"

                Again, the intent is to allow/disallow access to a pull-down navigation menu based on the user type (customer/technician) as defined during login to the site. I am open for suggestions on how to implement this.
                • 5. Re: server side include syntax
                  Peter Grainge Adobe Community Professional (Moderator)
                  Does the fact that you are using pull down menus mean you are suppressing the usual TOC pane in a help file?

                  Instead of using pull down menus you could create different outputs using conditional tags and then the TOC would adapt itself to what is in that build.

                  On the subject of demanding respect in your other post, I have seen people "demand respect" before. You know, not one of them got too much of it. The people who did get it were the ones who earned it.

                  • 6. Re: server side include syntax
                    HKabaker Level 2
                    SpaGeek,

                    Thanks for bringing this technique to our attention. I decided to try it.

                    I started a new project with First_topic.htm, Second_topic.htm, Third_topic.htm, Fourth_topic.htm, and so on.

                    Using your example above,

                    <h1>Title</h1>
                    <!-- #include file="path/filename" -->

                    I inserted the include line in Third_topic.htm in RoboHelp TrueCode to refer to First_topic.htm. I closed and reopened the RH project, looked at the TrueCode, and RH was content enough with the line that it inserted a return before and after it.

                    However, when I generated WebHelp, RH completely ignored the inserted code. It did not appear in the output, but it remained in the RH TrueCode through several closings and reopenings of the project.

                    In fact, isn't it the purpose of the !-- and -- tags to insert a code comment that will be ignored?

                    The result was the same whether I inserted the code outside of RoboHelp, with the project closed in RH or with the project open in RH. After saving one in Notepad while RH was still running, I refreshed the screen in RH and the code was there, untouched.

                    I don't have DreamWeaver, so perhaps there's where your problem lies.

                    Still, if RH is going to ignore it on output, what's the point?

                    Maybe a different example will show the problem. Would you like to post one?

                    With respect,

                    Harvey

                    • 7. Re: server side include syntax
                      SpaGeek Level 1
                      Yes, the TOC is suppressed. I thought of conditional tags but because of the state of the project (over 11,000 files) I have tried to find other (read easier) solutions. I initially thought that a simple global substitution on this unique text string changing it to an include statement would be a good, quick compromise.

                      The feature of the pull-down menus allows technicians to quickly jump from one product to another. There are actually a pair of pulldowns: one for the model and the other for the year. This help system is used by CSRs for telephone support of customers and field technicians. The customer-accessible feature is a change in the project's original scope. Trying to get it to work without maintaining two help systems is the goal.

                      I have tested this include statement angle in different ways on vanilla pages and it seems hopeless. Upon generation the syntax is basically ignored as a comment. I believe that it just cannot be done with the current version - most likely never since its scope was not intended to do something like this. Unless someone knows how to "trick" it into working, I think that it is a dead issue, maybe something for a future release.

                      Politics - what lessons there are here. I get irritated when people plow over newbies making them feel inferior. The purpose may have been to have me "Read The Fine Manual" but I believe that words are powerful things. I am sensitive to the word "hate" and it pushed a button - I pushed back. There is too much hate in the world today and here it is really not needed. What purpose did using this word serve? Obviously, this happens. People make mistakes. I am a person.
                      • 8. Re: server side include syntax
                        SpaGeek Level 1
                        The massaging of the closing tag must be a function of how the page is built (another issue I'll deal with later). As Harvey mentions and I have similarly confirmed, the real issue with the include statement is with its syntax. Here, RH (specifically HTML Help) assumes that it is a comment when in fact it is a valid HTML tag (as identified by the presence of the pound sign). So upon generation, it just ignores the content.

                        With respect,
                        Phil
                        • 9. Re: server side include syntax
                          Peter Grainge Adobe Community Professional (Moderator)
                          My comments have nothing to do with you being a newbie to this forum, I would have said the same had you made 10,000 posts. Rick has made it quite clear to you that it is cross posting he hates because it makes the forum more difficult to use and wastes people's time. That observation only needed an "oops" type response. You say there is too much hate around yet you tell Rick to get a life before he had a chance to respond to your objection!

                          • 10. Re: server side include syntax
                            SpaGeek Level 1
                            Yup, you're right. I attacked him when I felt attacked. But that's how I am as I explained.

                            Regarding the issue, I actually got help rather than politics from another source that seems to explain even more about why this will never work. FYI, click on this link:
                            http://support.microsoft.com/kb/896358
                            • 11. Re: server side include syntax
                              Peter Grainge Adobe Community Professional (Moderator)
                              You also got help from Rick who asked some questions as a prelude to working with you and I gave you a solution which I did not know you had considered and discounted.

                              I am not clear how the Microsoft post explains why your code is being reworked as it is about running CHMs on a network. Some workrounds for that issue appear on my site. I would add that I have not reread it in detail.

                              • 12. Re: server side include syntax
                                HKabaker Level 2
                                SpaGeek,

                                You haven't said whether you are outputting a CHM file or a WebHelp package.

                                If it's WebHelp, have you tried inserting the "include" statement in the output files after generating WebHelp?

                                Harvey
                                • 13. Re: server side include syntax
                                  SpaGeek Level 1
                                  Harvey,
                                  I think you are on to something here. It would involve a post-generation global-editing session but that could be easily done. I believe that it will work just fine. Thanks for the help.
                                  Phil
                                  • 14. Re: server side include syntax
                                    Peter Grainge Adobe Community Professional (Moderator)
                                    Spa Geek

                                    I'd be interested to learn how the Microsoft topic explained why what you were doing would never work.

                                    • 15. Re: server side include syntax
                                      SpaGeek Level 1
                                      Hi Peter,
                                      After re-reading the message, it did not supply what I believed it did in the way of a suggestion.
                                      Phil