Question about Server Side Includes [Solved]

Discussion about MagicEdit features, modules, applications, and HowTos.

Question about Server Side Includes [Solved]

Postby guiding » Wed Jul 31, 2013 4:05 pm

Two part question but part and parcel for my needs.

1. On this page SSI files are saved with the .shtml extension. In order to get ME to work with SSI do I need the .shtml extension?

2. If .shtml is not needed then can you help me figure out why the me_names on the attach SSI sample isn't working?

inc_menu.html
Code: Select all
<header>
       <div class="top_line">
           <div class="container">
                <div class="call_us"><span class="ico">p</span>Call us toll free: <magicedit me_plain me_name="phone">+1 800 546 35 48</magicedit></div>
                <div class="socials">
                    <ul class="socials_list">
                        <li><a magicedit me_name="facebook" href="#" class="ico_social-facebook"></a></li>
                        <li><a magicedit me_name="twitter" href="#" class="ico_social-twitter"></a></li>
                        <li><a magicedit me_name="youtube" href="#" class="ico_social-youtube"></a></li>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="header_wrapper container">
           <!-- <a href="index.html" class="logo" me_name="logo" magicedit></a> -->
         <!-- <img magicedit src="img/logo.png" alt="" width="200" class="logo_def"> -->
         <a magicedit me_name="logoLink" href="index.html" class="logo">
            <img magicedit me_name="logoImg" src="img/logo.png" alt="" width="200" class="logo_def">
         </a>
         
         <!--
         <a magicedit me_name="imageLink" href="#">
            <img magicedit me_name="myImage" src="myimage.jpg" width="400" />
         </a>
         -->
         
         <!-- <img src="img/retina/logo.png" alt="" width="200" class="logo_retina">-->
            <nav>
                <ul class="menu">
               <li><a href="index.html">HOME</a></li>
               <magicrepeat>
                  <li><a href="newpage.html"><magicedit me_plain me_name="newpage">NEW PAGE</magicedit></a></li>
               </magicrepeat>
            </ul>
                <div class="clear"></div>
            </nav>
           
            <div class="head_search">
                <form class="search_form" method="get" name="search_form">
                    <input type="text" class="field_search" title="Search..." value="Search..." name="s">
                </form>
            </div>
           
        </div>
    </header>


The phone number isn't the same across all pages.
The logo isn't the same across all pages.
New menu links is the only thing that works at the moment.

Thank you.
Last edited by guiding on Fri Aug 02, 2013 10:38 am, edited 1 time in total.
guiding
 
Posts: 17
Joined: Tue Jan 15, 2013 1:45 pm

Re: Question about Server Side Includes

Postby vitaliy » Thu Aug 01, 2013 10:51 am

1. With magicedit you don't have to use .shtml extension for includes to work.

2. Can you provide the code example of how you are including this page in the other one? It's hard to see what's going on without the other page.
vitaliy
 
Posts: 9
Joined: Tue Apr 12, 2011 3:30 pm

Re: Question about Server Side Includes

Postby guiding » Thu Aug 01, 2013 12:08 pm

To keep things simple I'm only including the parts of the code that matters...

The phone number is located in inc_menu.html
Code: Select all
<div class="call_us"><span class="ico">p</span>Call us toll free: <magicedit me_plain me_name="phone">+1 800 546 35 48</magicedit></div>


The logo is also located in inc_menu.html
Code: Select all
<a magicedit me_name="logoLink" href="index.html" class="logo">
   <img magicedit me_name="logoImg" src="img/logo.png" alt="" width="200" class="logo_def">
</a>


Both of these are included in index.html
Code: Select all
<!DOCTYPE html>
<head>
<title>Client name</title>
</head>
<a name="top"></a>

<body>
   <!--#include file="inc_menu.html" -->
</body>
</html


inc_menu.html is also included in the new page template newpage.html
Code: Select all
<head>
<title><magicedit me_name="newpage">New Page</magicedit></title>
</head>
<a name="top"></a>

<body>
   <!--#include file="inc_menu.html" -->
</body>
</html


The code to create a new template is found inside inc_menu.html and looks like this
Code: Select all
<ul class="menu">
   <li><a href="index.html">HOME</a></li>
   <magicrepeat>
      <li><a href="newpage.html"><magicedit me_plain me_name="newpage">NEW PAGE</magicedit></a></li>
   </magicrepeat>
</ul>


The difference between index.html and newpage.html is one acts as the homepage while the other dynamically creates new pages. Besides that I believe I'm using the me_name correctly in the inc_menu.html. That being said I don't understand why changing the phone or logo on one page doesn't propagate to all pages.
guiding
 
Posts: 17
Joined: Tue Jan 15, 2013 1:45 pm

Re: Question about Server Side Includes

Postby vitaliy » Thu Aug 01, 2013 12:56 pm

I see your problem.

You need to use a global magicedit region. When placing magicedit region in side a magicrepeat all magicedit regions are unique to that magicrepeat. If you want for some magicedit regions to be the same thought the site, (on a repeat page or not), you need to make magicedit region global. Simply add me_repeat="no" to each magicedit region that you want to stay the same thought the site. It's very simple.

for example, if you want the logo to be the same thought:
Code: Select all
<a magicedit me_name="logoLink" href="index.html" class="logo">
<img magicedit me_name="logoImg" src="img/logo.png" alt="" width="200" class="logo_def">
</a>


just do this:

Code: Select all
<a magicedit me_name="logoLink" href="index.html" class="logo">
<img magicedit me_name="logoImg" me_repeat="no" src="img/logo.png" alt="" width="200" class="logo_def">
</a>


That should do it.

You can learn more about global regions here (scroll all the way to the bottom):
http://www.magicedit.com/MagicEditTags.cl

By the way, I'm not sure why you adding "magicedit me_name="logoLink" " to the link wrapping the image. This is not necessary. Unless you what the actual link or url editable, you don't have to put magicedit on the link to edit the image. I would remove that and make the link as usual and leaving magicedit only on the image.
vitaliy
 
Posts: 9
Joined: Tue Apr 12, 2011 3:30 pm

Re: Question about Server Side Includes

Postby guiding » Thu Aug 01, 2013 5:49 pm

Wonderful! Thanks. That worked.

vitaliy wrote:By the way, I'm not sure why you adding "magicedit me_name="logoLink" " to the link wrapping the image. This is not necessary. Unless you what the actual link or url editable, you don't have to put magicedit on the link to edit the image. I would remove that and make the link as usual and leaving magicedit only on the image.


I found a post by raw10 on another forum where he said if the person wanted to edit the image and link magicedit would need to be added to both image and anchor tags. Is there an easier way to combine this into a single MagicEdit? That would really nice.
guiding
 
Posts: 17
Joined: Tue Jan 15, 2013 1:45 pm

Re: Question about Server Side Includes

Postby vitaliy » Thu Aug 01, 2013 7:14 pm

Yes, if you want to edit both the link and the image you need magicedit on both elements. Things are getting more complicated from there though. It could get confusing for the user to know witch button is for what, and you might need to apply some extra css to move buttons around. I would suggest to use one or the other, if you need to edit the link make it editable, but pull the image from somewhere else by using the same me_names.

Grouping edits feature is in the works. You would be able to group regions and edit them in one shot.
vitaliy
 
Posts: 9
Joined: Tue Apr 12, 2011 3:30 pm

Re: Question about Server Side Includes [Solved]

Postby guiding » Fri Aug 02, 2013 10:42 am

MagicEdit is the solution my employer has decided on for this client.

It might be advantageous to create a special ME tag or magicedit treatment to give MagicEdit users the ability to edit the anchor and image of linkable images in a single pass. I've use linkable images more than a few times on many different sites.
guiding
 
Posts: 17
Joined: Tue Jan 15, 2013 1:45 pm


Return to MagicEdit Discusson

Who is online

Users browsing this forum: No registered users and 1 guest

cron