# Question
Title: EE 2.7 / Krea Content Elements 1.5.5: Rich Text formating Buttons missing after updating
After updating EE from 2.6.1 to 2.7. the Content Elements Richtext-field lost the formatting buttons. I updated CE to 1.5.5 but the buttons are still missing. When I add a standard EE Richtext field the buttons are available. I installed and uninstalled CE but that didn´t help.

# Answer
> 1 votes
I had an issue with format buttons not showing on the front end of my Channel Forms, latest release needs you to render the css file on your site, maybe this is the issue as I assume CE will need to release an update to ensure this is picked up also.

---
Tags: richtext, content-elements
---


# Question
Title: Structure - subnav shows full nav, not sure why
*updated with EE and Structure Version*

EE 2.7.2 Structure 3.3.4

I'm building a site with structure and for each section of the site the child pages will be in the side bar so that if I'm on domain.com/about In the sidebar I will see:

About (h4 tag)

--sub page

--sub page

--sub page

However with the code (below) I"m using it output all entries for the entire site. Please advise.

```
{exp:structure:nav
    css_class="side_navigation"
    start_from="/{segment_1}"
}

```

What I end up with however is

About

-- subpage

-- subpage

-- subpate

Services

-- subpage

-- subpage

etc...

# Answer
> 1 votes
I just resolved this, turns out it was a low variables/parse order issue. I needed to preparse segment\_1 etc... on the main template. My code now looks like this

```
    {!--sidebar--}
    {exp:low_variables:single var="lv-sidebar"
      preparse:pre_seg_1="{segment_1}"
      preparse:pre_seg_2="{segment_2}"
      preparse:pre_seg_3="{segment_3}"
      preparse:pre_top_title="{structure:top:title}"
    }

```

And then in the Low Variable I have this:

```
<h4>{pre_top_title}</h4>

{if structure:child_ids != ''}
    {exp:structure:nav
        css_class="side_navigation"
        start_from="/{pre_seg_1}"
    }
{/if}

```

Now weverything works just fine

# Answer
> 0 votes
Why don't you use the last version of Structure? 3.3.13 It seems that in version 3.3.12 a update was made for Nav tag output bug for ee 2.7

Francois

---
Tags: templates, structure, navigation
---


# Question
Title: Multiple ul tags in columns within single channel entry tag
Trying to see if there is a way natively in EE (2.7.3) not just to switch classes within a ul but to have multiple instances of ul tags within one channel entry without using add-ons like switch?

```
<ul class="sub">
<li>A</li>
<li>B</li>
<li>C</li>
</ul>

<ul class="sub">
<li>D</li>
<li>E</li>
<li>F</li>
</ul>

```

# Answer
Now that ExpressionEngine includes a **modulus operator** (as of 2.7.1), you can also use that instead of `switch` if you prefer.

Here are a couple of examples that both accomplish the same result.

**Using modulus to conditionally output *all* opening and closing html tags:**

```
{exp:channel:entries channel="news"}

    {if count % 3 == 1}
        <ul class="sub">
    {/if}

    <li>{title}</li>

    {if count % 3 == 0 OR count == total_results}
        </ul>
    {/if}

{/exp:channel:entries}

```

...OR....

Put the first opening tag and the final closing tag *outside* of `channel:entries` and **use modulus only for conditional closing and re-opening of blocks of html:**

```
<ul class="sub">
    {exp:channel:entries channel="news"}

        <li>{title}</li>

        {if count % 3 == 0}
            </ul>
            <ul class="sub">
        {/if}

    {/exp:channel:entries}
</ul>

```

Either of these examples will work and will always ensure that you have proper tag closure. It's just a matter of preference.

EE Documentation on Modulus Operator
> 1 votes

# Answer
The switch variable takes html as well. In case of your example:

```
{switch='<ul class="sub">||'}
<li>{title}</li>
{switch='||</ul>'}

```
> 2 votes

---
Tags: ee2, channel-entries, list
---


# Question
Title: Matrix is killing my load times - How can I speed it up
This just started happening with the latest updates.

My product pages went from under a couple of seconds, to 12-16 seconds. All spikes below are from Matrix calls.

click to see larger image

I am at a loss on what to do as rebuilding the pages without using the matrix field is a ***major*** rework.

Any ideas?

*** EDIT *** It's a huge Matrix field. The odd thing is that this is coming from a EE 1.6.8 rebuild and it ran fast on that setup with the same data and more conditionals in the template. I figured it would run faster on EE2.

Here is the complete field:

click to see larger image

*** EDIT *** Here is the template code:

```
        {app_product_info}

            {if hover_grid_options == "none"}

                <div id="article-{row_count}" class="row">

                    {!-- ARE WE USING PLACED IMAGES --}
                    {if image}

                        {!-- EVERYTHING BUT THE BOTTOM SELECTED IMAGES NOW --}
                        {if image_location != "bottom"}

                            {!-- DOES THE USER WANT TO TRIGGER A GALLERY EFFECT --}
                            {if larger_image}
                                <a href="{larger_image}" class="align-{image_location}"><img class="larger align-{image_location}" src="{image}" /></a>
                                {if headline}
                                    <h1{if image_location == "center"} style="margin-top: .5em;"{/if}>{headline}</h1>
                                {/if}
                                {copy}
                            {if:elseif video_link}
                                <a class="video_launch video iframe" href="http://www.youtube.com/embed/{video_link}" /><img src="{image}" class="align-{image_location} larger"></a>
                                {if headline}
                                    <h1{if image_location == "center"} style="margin-top: .5em;"{/if}>{headline}</h1>
                                {/if}
                                {copy}
                            {if:else}
                                <img src="{image}" class="align-{image_location}">
                                {if headline}
                                     <h1{if image_location == "center"} style="margin-top: .5em;"{/if}>{headline}</h1>
                                {/if}
                                {copy}
                            {/if}

                        {if:else}

                            {!-- DO THE BOTTOM IMAGES --}
                            {!-- DOES THE USER WANT TO TRIGGER A GALLERY EFFECT --}
                            {if larger_image}
                                {if headline}
                                    <h1>{headline}</h1>
                                {/if}
                                {copy}
                                <p>
                                    <a href="{larger_image}" class="align-{image_location}"><img class="larger align-{image_location}" src="{image}" /></a>
                                </p>
                            {if:elseif video_link}
                                {if headline}
                                    <h1>{headline}</h1>
                                {/if}
                                {copy}
                                <p>
                                    <a class="video_launch video iframe" href="http://www.youtube.com/embed/{video_link}" /><img src="{image}" class="align-{image_location} larger"></a>
                                </p>
                            {if:else}
                                {if headline}
                                    <h1>{headline}</h1>
                                {/if}
                                {copy}
                                <p><img src="{image}" class="align-{image_location}"></p>
                            {/if}

                        {/if}

                    {if:else}
                        {if headline}
                            <h1>{headline}</h1>
                        {/if}
                        {copy}
                    {/if}

                    {!-- CHECK FOR A VIDEO TAG --}
                    {if video_link && video_text}
                        <!-- BLOCKQUOTE VIDEO -->
                        <blockquote class="video" name="{video_link}">
                            {video_text}
                        </blockquote>
                    {/if}
                </div>

                {!-- ADD A HR TO THE PLACES IN NEED --}
                {if row_count != total_rows && image_location != "testimonial"}
                    <hr>
                {/if}

            {/if}

        {/app_product_info}

```

I added the template code in hopes it might help. This is the template that was running fine in EE 1.6.8 but failing miserably in EE 2.7.2

Each field in the Matrix determines a different outcome for the layout/options.

# Answer
> 5 votes
Unfortunately, there wasn't a good answer in getting this to work with Matrix. Everything I tried still resulted in a page load time of 14.6 - 17.2 seconds. I worked with EllisLab all day Friday from like 2-9. We spent the day debugging templates, analyzing output, checking for red flags, etc.. I completely rebuilt the template using the native Grid field and the render time dropped from the 15-ish mark to 2.3 seconds. I have an open ticket with P&T. I have given them the same log info and informed them of the changes and results. There is definitely something going on, but I don't know what it is. I will post here once a solution is delivered, when/if that happens though.

# Answer
> 1 votes
I have a bunch of ideas for things for you to try to learn more about what's going on, but I wanted to suggest the most obvious, first:

Are you up against the memory limits on your EE 2.x server? Is it possible that this page is causing the server to use swap (to disk) rather than processing fully in memory?

In the graph you've posted, it looks like the memory is topping-out at 16MB, and that seems suspicious and low. Can you check your memory limit settings in PHP, and, if necessary, your server memory limits, and make sure that you have a lot of free memory when you're testing the load time on this page. Report back in the memory seems to be a factor, or not.

---
Tags: ee2, matrix, pixelandtonic, performance, loading-time
---


title: Using switchee to detect pagination

text:
# Question
Title: Using switchee to detect pagination
I'm using Switchee to detect pagination.

Switchee is working fine for: /new/PX/

I also use Zoo Triggers for categories and archives and have the following pagination URL's too:

* /news/category/abc/PX (segment 4)
* /news/archive/yyyy/mm/PX (segment 5)

It doesn't look like I can pass multiple values to the *variable* parameter so is it best to call Switchee multiple times in the template or is there a better approach?

```
{exp:switchee variable="{triggers:segment_2}" parse="inward"}
    {case value="#^P(\d+)$#"}
    // Do something
    {/case}

    {case value="''" default="Yes"}
    // Do something
    {/case}
{/exp:switchee}

{exp:switchee variable="{triggers:segment_4}" parse="inward"}
    {case value="#^P(\d+)$#"}
    // Do something
    {/case}

    {case value="''" default="Yes"}
    // Do something
    {/case}
{/exp:switchee}

{exp:switchee variable="{triggers:segment_5}" parse="inward"}
    {case value="#^P(\d+)$#"}
    // Do something
    {/case}

    {case value="''" default="Yes"}
    // Do something
    {/case}
{/exp:switchee}

```

Any help would be appreciated!

# Answer
> 1 votes
I tried Bjorn's last segment plugin to get the absolute last segment and that worked. Weird...

http://devot-ee.com/add-ons/bjorn-last-segment

Switchee tag:

`{exp:switchee variable="{exp:last_segment ignore_pagination='no'}" parse="inward"}`

# Answer
> 0 votes
`{triggers:last_segment}` ?

And here's a useless sentence to make this answer long enough to post...

---
Tags: pagination, switchee, zoo-triggers
---


title: File Upload Preferences not saving

text:
# Question
Title: File Upload Preferences not saving
I am trying to make a change to the URL and Server Path of the File Upload Preferences section, but when I click "update" the page refreshes and the changes are gone. I don't have this issue anywhere but on the File Upload Preferences page, does anyone know what would be causing this?

Thanks in advance!

# Answer
It might be possible that in your config file that the upload preferences are being set via the config override. You will want to look for something along the lines of:

```
$config['upload_preferences'] = array(
    1 => array(                                                            // ID of upload destination
        'name'        => 'Staging Image Uploads',                          // Display name in control panel
        'server_path' => '/home/user/example.com/staging/images/uploads/', // Server path to upload directory
        'url'         => 'http://staging.example.com/images/uploads/'      // URL of upload directory
    )
);

```

You can find the full documentation here
> 6 votes

---
Tags: settings, site-preferences
---


title: cached relationship entries db error

text:
# Question
Title: cached relationship entries db error
I've been trying to clear the caches prior to running this EE upgrade but when I do I'm getting this error:

```
A Database Error Occurred
Error Number: 1054

Unknown column 'rel_data' in 'field list'

UPDATE pfra_relationships SET rel_data = '', reverse_rel_data = ''

Filename: libraries/Functions.php

Line Number: 1205

« Back

```

I don't think this is going to help my overall upgrade path on this project but would be good to know what's going on.

# Answer
So the config file for this site had:

```
$db['expressionengine']['swap_pre'] = "pfra_";

```

when it should in fact have been

```
$db['expressionengine']['swap_pre'] = "exp_";

```

even although the db tables are all set with a prefix of pfra\_
> 1 votes

---
Tags: database, cache, database-error
---


title: segment begins with?

text:
# Question
Title: segment begins with?
Is there a way, WITHOUT PHP, to test if a segment begins with a value?
We send emails with shortened URLs and want to be able to parse the segments accordingly.

i.e.

```
http://www.oursite.com/20140709XXXYY

```

would need to redirect to

```
http://www.oursite.com/event/20140709XXXYY

```

Or, is there a way to do this in .htaccess?

Yes, they will always be the similar to the one above, plus, we may also have some like this:

```
http://www.oursite.com/agenda/20140709XXXYY

```

which would need to redirect to

```
http://www.oursite.com/Chuy/DownloadFile2.aspx?File=Q:\\AGENDAS\\20140709XXXYY.pdf

```

# Answer
> 1 votes
It sounds like you are looking for a way to manage redirects using ExpressionEngine. You could do it with htaccess, yes, but it's really convenient to do it with EE.

Take a look at **Detour Pro.**

Since you have some redirects that are repetitive in nature, it's possible you could make use of Detour Pro's "Wildcard Redirect" or "Wildcard Redirect with Segment Replacement" feature.

If that's not quite right, or if you want an alternate see Anna's suggestion of Router.

> Router will automatically include the correct template for you, based on which of your regex patterns match the current URL.

# Answer
> 1 votes
Two additional "routing" addons:

**Template Routes**
http://devot-ee.com/add-ons/template-routes

**Router**
http://devot-ee.com/add-ons/router

---
Tags: url, segments, parsing
---


title: Exporting an XML file per order

text:
# Question
Title: Exporting an XML file per order
We have a store setup using ExpressionEngine and Expresso Store, it's all working great however we now need to integrate with another system. This system imports information on orders, it's basically a CRM system, it required an XML file to be produced each time an order is processed, we've managed to produce an XML feed for these orders but unfortunatently it requires a seperate file for EACH order. This is the XML we produced:

```
<?xml version="1.0" encoding="UTF-8"?>
<Clarity xmlns="http://www.touchsystems.co.uk/schemas" Type="Order" DateTime="2011-04-04T17:58:41.000000" Source="Customer Website">

  {exp:store:orders}
  <Contact>
    <Name>{billing_name}</Name>
    <Company></Company>
    <Telephone>{billing_phone}</Telephone>
    <Email>{order_email}</Email>
    <Address>
      <Address1>{billing_address1} {billing_address2}</Address1>
      <City>{billing_address3}</City>
      <County>{billing_region_name}</County>
      <Postcode>{billing_postcode}</Postcode>
      <Country>United Kingdom</Country>
    </Address>
    <Detail>
      <Title></Title>
      <Extension></Extension>
      <Fax></Fax>
      <Website></Website>
    </Detail>
    <Comment></Comment>
    <Document>
      <Title>Online Order REF {order_id}</Title>
      <Notes>Here are some example order notes</Notes>
      <Detail>
        <Terms>Delivery within 30 days of payment</Terms>
        <CustOrderNo>{order_id}</CustOrderNo>
        <RequiredDate>{order_date}</RequiredDate>
      </Detail>
      {items}
      <Item>
        <Partcode>{sku}</Partcode>
        <Description>{title} {modifiers}{modifier_name} {modifier_value} {if price_mod_val}({price_mod}){/if}{/modifiers}</Description>
        <Quantity>{item_qty}</Quantity>
        <UnitPrice>{price} - {item_subtotal}</UnitPrice>
      </Item>
      {/items}
      <Totals>
      </Totals>
      <DeliveryAddress>
        <Contact>{shipping_name}</Contact>
        <Address1>{shipping_address1}</Address1>
        <Address2>{shipping_address2}</Address2>
        <City>{shipping_address3}</City>
        <County>{shipping_region_name}</County>
        <Postcode>{shipping_postcode}</Postcode>
        <Telephone>{shipping_phone}</Telephone>
      </DeliveryAddress>
    </Document>
  </Contact>
  {/exp:store:orders}
</Clarity>

```

But we're not really sure how to go about generating a single XML file per order, will we need to do this with PHP or can ExpressionEngine handle this? Any ideas would be really appreciated!

# Answer
> 3 votes
Looks like you have working code to generate XML for multiple orders, and generating XML for a single order is easy by just including the `order_hash` or `order_id` parameter.

The only problem then is how to move these files into an FTP directory for your CRM. To do this you could either set up a nightly script to check for new orders and save their XML to a particular folder, or as Derek mentioned in the comments, you could use the `store_order_complete_end` hook to do this immediately after the order is saved.

# Answer
> 3 votes
You could have an admin-only page where you list orders using `store:orders`, and have each link to the order detail via its `order_hash`.

```
{exp:store:orders}
{if count  == "1"}<ul>{/if}
    <li><a href="{path="orders/view/{order_hash}">Order #{order_id}</a></li>
{if count  == total_results}</ul>{/if}
{/exp:store:orders}

```

Then **orders/view** looks like:

```
{exp:store:orders order_hash="{segment_3}"}
    // your XML template here
{/exp:store:orders}

```

You'd want to add something like `{if logged_in_member_group != "1"}{redirect="404"}{/if}` to each page to make sure prying eyes could not see.

---
Tags: expresso-store, xml, export
---


# Question
Title: Show / Hide Modifiers Based on Selection
I'm trying to show / hide modifiers based on a selection. For instance I am building a store who rents licenses for a period of time (3, 6, and 12 month). I want to show a different set of options based on one of the selections above. Is there an easy way to do that?

# Answer
> 1 votes
I don't believe there is anything out of the box that can do that. I'd likely rework the logic and create 3 separate products with modifiers required and either via JavaScript or URL segments load required 'product'.

You could load all 3 on one page and via JavaScript hide them and use a simple radio group to trigger a show/hide function or load via ajax.

# Answer
> 1 votes
EE won't do that out of the box (that I know of). You're looking for a 'chained select' option, I think - where the first select determines the options available of the second select.

Depending on what your needs are, try one of these jquery:

# Answer
> 0 votes
It's not possible out of the box with Store. As long as your chained select options don't require price modifiers, you could do this using a jQuery chained select plugin as mentioned above, combined with "custom text modifiers", which allow you to submit arbitrary text fields along with the order:

https://exp-resso.com/docs/product\_tag.html#inputcustom\_modifier\_name

You could also simply add all the possible modifier options in the publish page, and then use one of the jQuery select plugins to only display the correct modifiers to uses on the front end. How complicated this will be depends on how many products you have like this which need to be set up.

---
Tags: expresso-store
---


# Question
Title: Can I pull parent data from ee channels into Solspace Calendar?
How do I, whithin solspace calendar tagpairs, pull data from en ee channel being the parent of the event through ee's relationships tag?

My plan is to keep most articles in an ee:channel and via relationships associate those articles that cover events with Solspace calendar module. Then within solspace calendar tagpairs list only those events that has parents in the articles channel and pull titles and paths to the associated articles entry.

I fear Solspace Calendar doesnt like normal relationships and I really hope to find out my fear is without reason. Croxtons Stash is in my toolbox but I am far from mastering it.

So how do I, whithin solspace calendar tagpairs, pull data from en ee channel being the parent of the event through ee's relationships tag?

# Answer
> 1 votes
Except for event date/time data, Calendar channels, both "Calendar: Calendars" and "Calendar: Events", remain mostly channel entries. This means that you can use `{exp:channel:entries}` to get your parent entries like this:

```
{exp:channel:entries channel="calendar_events" /* your other parameters */}
    {parents field="event"} {!-- <== Your "Articles" relationship field --}
            {parents:title} - {parents:field1} - {parents:field2}
    {/parents}
{/exp:channel:entries}

```

However, when using `{exp:channel:entries}` you won't be able to retrieve data such as `{event_start_date}` or `{event_end_date}`. Since `{exp:calendar:events}` shares the Channel:Entries library, `{exp:calendar:events}` might work instead to get you both your parent data, while still having access to Calendar date/time event data.

In some cases `{exp:calendar:cal}` needs to be used to display events chronologically. In this case the Channel:Entries library isn't being called so standard EE relationship tags won't work. In this case you might need to pass `{event_id}` values in an embed containing {exp:channel:entries} as in the above example, i.e.:

```
{exp:calendar:cal /* your parameters */}
    // Whatever event data you need to display
    {embed="calendar/parent_entries" child_entry_id="{event_id}"}
{/exp:calendar:cal}

```

Then, in your "calendar/parent\_entries" embed, use {exp:channel:entries} similar to above:

```
{exp:channel:entries channel="calendar_events" entry_id="{embed:child_entry_id}" dynamic="no" /* your other parameters */}
    {parents field="event"} {!-- <== Your "Articles" relationship field --}
            {parents:title} - {parents:field1} - {parents:field2}
    {/parents}
{/exp:channel:entries}

```

---
Tags: relationships, solspace, solspace-calendar, calendar
---


# Question
Title: Multi Site Manager gives 404 when using Sub Folder
We have setup Multisite Manager but we are not using sub-domains, we want them in sub-folders. The EE instructions do not reference this setup, only domains and sub-domains. Its not working for us, accessing a page on the site causes the default site 404 to kick in. We are using the Pages module, so segment\_1 would refer to the site\_url.

We have configured all the necessary settings in the instructions.

We have also added into Site 2's .htaccess file

```
RewriteBase /subfolder/

```

Note: Site 2's home page works fine. Its just pages. Template Groups are not called either (for example /news) so I don't think its a Pages issue.

Further, it seems Pages, being a module, is not copied when duplicating a site. Pages is empty, no templates are assigned. Although an old post, it is referenced here: http://ellislab.com/forums/viewthread/177005/#839555

Looks like I have to manually set it all up again, and edit each page. I did this but it still does not work.

I do not have a Template Group named as my sub-folder.

Anyone know any extra configuration steps for sub folders?

Thanks

# Answer
> 2 votes
Ha ha, found it!

Removing index.php code in the .htaccess file also needed updating.

Original RewriteRule to remove index.php:

```
RewriteRule ^(.*)$ /index.php?/$1 [L]

```

New RewriteRule needs the sub-folder added to the RewriteRule:

```
RewriteRule ^(.*)$ /subfolder/index.php?/$1 [L]

```

**Note**: the question mark after index.php depends on a server setting, so dont copy and paste, but check first what yours is.

---
Tags: multi-site-manager, 404
---


# Question
Title: Delivering images via HTTPS protocol using {image}?
I am using ExpressionEngine for an e-commerce site and it is using the HTTPS protocol site-wide. HTTPS is failing on my homepage because the images are being delivered(using `{image}`) from the HTTP protocol. I am wondering how I can tell ExpressionEngine to deliver these images via HTTPS instead.

Any help greatly apprecaited!

# Answer
Try using relative paths in your upload preferences.
> 4 votes

---
Tags: channel-images, secure
---


# Question
Title: Converting spaces in file_url with CE String
Using the Grid we've have a project where a large number of files have been uploaded with spaces in the file names. We want to encode the URLs so the files can be downloaded.

To try to solve this we used CE String and `{exp:ce_str:ing urlencode}{file_url}{/exp:ce_str:ing}` but it doesn't seem to fix the issue.

Allow PHP is set to Yes and Parsing Stage is Output.

Any suggestions or alternatives would be greatly appreciated.

# Answer
I believe ExpressionEngine actually takes care of the issue for you by automatically encoding the spaces as `%20`. You shouldn't need to use a plugin or enable PHP.

To check this just output the Grid row's `{file_url}` and you should see it encoded.

```
{my_grid_field}
    <li>{my_grid_field:file_url}</li>
{/my_grid_field}

```

If the file you uploaded was named `some file.png` then the output of the above should be `/my_upload_dir_path/some%20file.png`

Is this not what you observe? Let me know if this misses the boat somehow.

As an aside, the EE file fieldtype seems to automatically convert spaces in filenames to underscores on upload, so I believe this shouldn't even come up unless you uploaded via another means.
> 2 votes

---
Tags: channel-entries, file-uploads, url, fieldtype
---


# Question
Title: Future dating entries not displaying when current
Any future-dated entries are not displaying for me once the entry date is current. The exception is if I touch any entry in the channel (which is nice that it busts the cache, but it rather defeats the purpose of future dating). I have global caching enabled, but not on the template itself. Caching provides a nice speed improvement, so I'm hoping the answer isn't to disable it entirely.

```
{exp:channel:entries channel="mychannel" show_future_entries="no" limit="1" orderby="entry_date" sort="desc" disable="categories|member_data"}
    Most recent: {title} - {entry_date format="%D, %F %d, %Y - %g:%i:%s"
{/exp:channel:entries}

```

# Answer
You can't use cache in that case, as explain in the doc: "Enable this feature only if you do not use future entries, expiring entries, or random entries."

If you need cache, try to automatically clean up it every x minutes with a cron task or scheduled task.
> 3 votes

---
Tags: entry, future-entries, cache-breaking
---


# Question
Title: Calendar doesn't show up in add-on modules
I've had no luck installing the Calendar.

After uploading the calendar folder to /system/expressionengine/third\_party/ and to ./themes/third\_party/ - the calendar doesn't appear on the modules page.

I'm running EE v2.7.2 - Build Date: 20131008

# Answer
> 2 votes
You have checked that you have a /calendar folder in both those locations and that there are files in them? look for mod.calendar.php,there should be 14 files and 4 folders in /system/expressionengine/third\_party/calendar

---
Tags: solspace, solspace-calendar
---


# Question
Title: {categories} tag pair not parsing contents
I'm trying to clear ce\_cache of a category given a specific entry's set of categories. This doesn't seem to work and I think it's because the `{categories}` tag pair isn't quite a full implementation of the `parse_variables()` function. Any thoughts on how to accomplish the following?

```
{exp:channel:entries channel="channel"
    sort="desc"
    orderby="entry_date"
    dynamic="no"
    limit="1"
    offset="1"
    disable="category_fields|custom_fields|member_data"}

    {categories}
    {exp:ce_cache:clear items="local/category/{category_url_title}" refresh="1"}
    {/categories}

{/exp:channel:entries}

```

# Answer
It might be a parse order issue. If so, using Stash should work to save the categories into a variable list, and then you can run the ce\_cache:clear when outputting the list (this is untested):

```
{!--   cache a list of the category url titles   --}
{exp:stash:set_list
    name="cached_cat_url_title"
    parse_tags="yes"
    trim="yes"
}
    {categories}
        {stash:cat_url_title}{category_url_title}{/stash:cat_url_title}
    {/categories}
{/exp:stash:set_list}

{!--   output the list of category url titles, breaking the cache for each one   --}
{exp:stash:get_list
    name="cached_cat_url_title"
    parse_tags="yes"
    process="end"
}
    {exp:ce_cache:clear items="local/category/{cat_url_title}" refresh="1"}
{/exp:stash:get_list}

```
> 2 votes

---
Tags: channel-entries, categories, cache, ce-cache
---


# Question
Title: How to add a custom on/off setting for client
My client has requested the ability to turn a specific, site-wide feature on and off from the site-wide header. It’s a link to a specific page that they would like to “turn on” months after the launch. Removing the link makes leaves a bit of a gaping hole, so I’ve created a special class to be applied to the header element to make some other content take up that space.

I can switch this class on and off by using a snippet or global variable, but I would like to allow my client to change this setting at will without granting them access to design preferences and templates. Is there a cost-effective add-on that would allow me to provide this one on/off switch that my templates can then test for?

I’ve seen Panel and it looks great, but I’d be paying $35 for a whole lot of functionality I won’t be using.

# Answer
> 3 votes
I'd likely just do it with a channel entries loop - if only to take advantage of native publish and expiry date functionality so the client can schedule the publishing and hiding of the link you're referring to with ease, particularly if there is any changing content within the feature you're describing (which could then be handled on an entry by entry basis). And if no custom fields are actually needed within the loop, using the disable parameter you can knock the queries down to a minimal level and use the cache parameter to reduce it further still.

# Answer
> 2 votes
I’ve accepted Jean’s answer above, but wanted to document my own solution.

Because this particular case involved querying a single-entry channel, I simply used the status field of the entry to “turn the page on or off”, as it were. Any status that is not *Open* (that is, *Draft* or *Closed*) will yield zero results in my loop, so I use a no\_results conditional to set a stash variable with the class I need to make things right. See below:

```
{exp:channel:entries url_title="special-page" dynamic="no"}
  {if no_results}
    {exp:stash:set name="special-button"} my-special-class{/exp:stash:set}
    {!-- Notice space before special class. --}
  {/if}
{/exp:channel:entries}

<header class="masthead{exp:stash:get name='special-button' process='end'}" id="masthead">
<!-- Variable contains space. -->

```

If the page status is *Open*, then the stash variable is not set, and no class is set.

---
Tags: add-on, switch, settings, custom
---


# Question
Title: How to add a drop-down menu driven search that is field-specific per drop-down?
I have an existing drop-down menu search in place at http://www.ncwildflower.org/index.php/plant\_galleries/Quick\_Plant\_Mini-Search/

Or you can also see this on the main page centered at http://www.ncwildflower.org/index.php/ncnps

This site is still in version 1.6.8 because I had to change some code in the search regx file. It simply added two square brackets for the keyword entry, and concatenated the contents of any drop-downs that had content selected.

That was then - this is now!

I have no idea how to accomplish this feat in the Codeigniter-driven present-day EE 2.x.x!

Also, the existing solution was/is crude. If you select “red” as a bloom color drop-down, it simply adds “red” to the overall search terms, but is not specific to the bloom-color field, so it makes mistakes!

I’d like to have such a thing, but be able to make searches for bloom color only look in the bloom-color fields, and keywords for plant-type only refer to the plant-type fields. I’m sure you get my drift.

Anyone have any suggestions how I might at least start tackling this one? It is the only thing holding us back from updating to EE 2.x.x, as this feature is a favorite one by our readership.

Thanks for thinking about it with me!

Terry

# Answer
There are two search Modules that offer lots of flexibility. You'll need to dig through docs to make sure they match exactly what you need to do...

**Low Search**
http://gotolow.com/addons/low-search

**Solspace Super Search**
http://www.solspace.com/software/detail/super\_search/
> 2 votes

---
Tags: ee2, custom-fields, search, drop-down
---


# Question
Title: Difference between Template Parsing Finished and Total Execution Time in Debugging
I'm having major performance issues and I'm trying to nail down the culprit. I'm on EE 2.7.1 with a number of add ons (All of P+T's, Structure, ect.) However, I'm getting pages loads in excess of 5 seconds or even more. While I was combing through the Debugging I noticed that while Template Parsing would say one number, the Total Execution Time would give another number, sometimes twice as long as the Template Parsing time.

Here is one example

```
(2.658272 / 43.45MB) Template Parsing Finished
Total Execution Time    5.4786

```

I must be misunderstanding something, but I would have thought those two to be very similar instead of so far apart. Suggestions?

# Answer
> 4 votes
"Template parsing time" is only the time EE spent to render the page, but not the time creating connection to DB, runnning SQL queries, making system calls, etc.

Look at the SQL queries panel to see how many time is spent on each query. It should be a good start to understand why a page is slow.

# Answer
> 2 votes
Also, look in the debugging and watch for a jump in execution time. You will see pairs of numbers in the brackets that are the execution time and memory, and anything that is really slowing things down will show up as a jump in time.

For example:

(0.454163 / 21.26MB) Calling Extension Class/Method: Pt\_field\_pack\_ext/channel\_entries\_tagdata (2.519405 / 21.13MB) Calling Extension Class/Method: Playa\_ext/channel\_entries\_tagdata

Here you would note that the execution time has jumped by 2 seconds from one item to the next and you can look at what was being done at that time.

---
Tags: performance, debugging
---


# Question
Title: Editing pages from outside the Control Pane with two group id's
{if author\_id == logged\_in\_member\_id OR logged\_in\_group\_id == "1"} Edit This Page ⇑{/if}

I have added a second logged in group id "6" However, when I change this from 'logged\_in\_group\_id == "1"' to 'logged\_in\_group\_id == "1|6"'

it don't work…

how do I make this so both id == "1" and id == "6" can login?

# Answer
Adding another OR should work:

```
{if author_id == logged_in_member_id OR
    logged_in_group_id == "1" OR
    logged_in_group_id == "6"
}
    Edit This Page ⇑
{/if}

```
> 4 votes

---
Tags: control-panel, login
---


# Question
Title: Why are certain indexed entries being excluded from results? Could it be the special Status?
It seems I can't access certain indexed entries in a collection. Here are my form and results tags:

```
{exp:low_search:form channel="exposiciones|eventos|talleres|publicaciones" query="{segment_3}" result_page="search/results" no_result_page="search/noresults" search_in="everywhere" show_expired="yes" show_future_entries="yes" status="not closed" where="all" form_class="search_form" form_id="my_search_form" secure="no" loose_ends="yes"}

{exp:low_search:results
      query="{segment_3}"
      status="not draft"
      collection="exposiciones"
    }

```

I use Low Search to divide my results sets into different collections. But even if I use collection="all" and keyword ="" I get all results but the ones I cant access.

NOTE: The missing entries have a a custom Status, which is NOT part of the default "Statuses" group! Could this be the reason I cannot access them?

# Answer
First of all, Low Search doesn't work like EE's Simple Search. Most of the attributes you have set on the Form tag will do nothing, especially since Low Search v3. The `no_result_page`, `search_in` and `where` attributes do not belong to Low Search. Only these parameters are valid for the Form tag. Move the others to the Results tag instead. So you'll get:

```
{exp:low_search:form
    query="{segment_3}"
    result_page="search/results"
    form_class="search_form"
    form_id="my_search_form"
}
    ...
{/exp:low_search:form}

{exp:low_search:results
    query="{segment_3}"
    collection="exposiciones"
    channel="exposiciones|eventos|talleres|publicaciones"
    show_expired="yes"
    show_future_entries="yes"
    status="not closed"
    loose_ends="yes"
}
    ...
{/exp:low_search:results}

```

A couple of things could cause an entry to not show up:

* You have specified both `collection` and `channel`. Only entries from the channel associated with the given `collection` will be returned.
* The keywords given should contain terms that are present in the collection index. If the term is in a field that has 0 weight, the entry will not be returned, as the field is not part of the index.

Remember, the Results tag works just like the native channel:entries tag, just with added goods.
> 0 votes

---
Tags: search, low-search
---


# Question
Title: Error when upgrading EE - 'The update script failed without returning an error. Please contact tech support.'
I was upgrading an EE install from 2.5.2 to 2.5.5. First of all, I updated all the add-ons to make sure they were the latest versions. Then I added the new EE files as per the updating docs.

When running the upgrade, I got the following error message in a popup window after about 15 seconds:

```
The update script failed without returning an error. Please contact tech-support.

```

My hosting has plenty of memory (512mb) and execution time (60 seconds, though I even upgraded it to 600 seconds to rule it out as an issue) and has run dozens of upgrades before without any issues. I even tried upgrading from 2.5.2 to 2.5.3 instead, but got the same result.

# Answer
To workaround the issue, I followed the advice from this EE Support thread by renaming the system/expressionengine/**third\_party** folder to something else immediately before carrying out the upgrade. The upgrade then worked fine, and I renamed the third\_party folder back afterwards and all was well.

The explanation for having to do this (from the same EE support thread as above) is that 'the updater is trying to run the update scripts of third-party modules, so moving them out of the way lets the updater complete, then you can update third-party modules after.'

I'm sure that all my add-ons were already updated before carrying out the EE upgrade, so I suspect I either missed one through human error (unlikely as I double-checked them), or there was a rogue add-on that was causing an issue with the EE update script (but it would have taken too much time to pin-point which one after the above workaround worked).
> 7 votes

# Answer
Possibly safecracker\_file. Gave me some further problems after removing/replacing third part folder.
> 1 votes

---
Tags: add-on, upgrade
---


# Question
Title: Split channel entry data into rows / columns with stash
With Stash, is it possible to store pieces of EE channel entry data and insert it based on a count or some other logic?

I have a three column bootstrap grid below that splits an entry's data into two parts in the template.

Can I store and get the data based on a count or some other logic using Stash and Switch?

```
.row
- col {entry 1}
- col {entry 2}
- col {entry 3}

.row-two
- col {entry 1 data}
.row-two
- col {entry 2 data}
.row-two
- col {entry 3 data}

.row
- col {entry 4}
- col {entry 5}
- col {entry 6}

.row-two
- col {entry 4 data}
.row-two
- col {entry 5 data}
.row-two
- col {entry 6 data}

-etc-

```

# Answer
You can capture the entries as a Stash list and use fractions to split into parts:

**Setting the list:**
https://github.com/croxton/Stash/wiki/%7Bexp%3Astash%3Aset\_list%7D#capturing-channel-entry-data

**Getting the list and using fractions:** https://github.com/croxton/Stash/wiki/%7Bexp%3Astash%3Aget\_list%7D#using-fractions-to-split-lists
> 3 votes

---
Tags: stash, switch
---


# Question
Title: Renaming System Folder - Creates reload loop
I wanted to rename my system folder. But when I do so and point my browser to the new cp url I create a infinite reload loop and chrome goes nuts.

* Renamed system folder ***Check***
* Renamed system url in admin.php and index.php ***Check***

I've done it x times on the same environment and suddenly this loop error appears.

In my .htaccess I have the new remove index.php directives from the ellislab blog

```
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

First I thought this could be the error but it also doesn't work with the old index.php removal code.

Anybody experienced the same behavior?

EE v 2.72 PHP : 5.5.3

# Answer
Change the

```
RewriteCond %{REQUEST_URI} !/system/.* [NC]

```

line in htaccess to match the new system folder name:

```
RewriteCond %{REQUEST_URI} !/new_system_folder_name/.* [NC]

```
> 5 votes

---
Tags: htaccess
---


title: Example of Simple search form

text:
# Question
Title: Example of Simple search form
I have a created a website using expression engine. I would like to integrated search capability with it.

could some provide a sample code of how to integrate search and results in expression engine. I tried to copy and paste the following from here but it doesn't show any results.: http://ellislab.com/expressionengine/user-guide/modules/search/simple.html#par\_result\_page

```
    {exp:search:simple_form}
            <p>
                    <label for="keywords">Search:</label><br>
                    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100">
            </p>
            <p>
                    <a href="{path='search/index'}">Advanced Search</a>
            </p>
            <p>
                    <input type="submit" value="submit" class="submit">
            </p>
    {/exp:search:simple_form}

```

# Answer
> 1 votes
Creating and configuring the simple search form is task one and setting up the results template is task two for your search setup. If you follow the general examples provided in the documentation, you'll likely get most of the way there. The simple search tags you provided above lack a few key things - the channels you wish to have searched, the nature of the search (search\_in parameter), and the results page. There are other parameters you can take advantage of to refine how the search works.

---
Tags: search
---


# Question
Title: Uninstalled the Pages URI module and then re-installed it again... lost all my data and my site crashed.... HOW TO RESTORE
I had an issue with my MSM where it didnt allow me to "Submit" my entry and I have googled for the error and then I came across an answer which said to delete the "Pages" module. I did so and I didnt realize that I was going to hit hard by that step. Alfter I did that all my URLs got messed up.

I have around 1000 channel entries which basically make up my college website.

Is there anyway I can restore all the URLs..?? Please help me out with this.

# Answer
I would recommend restoring the site from a backup. Your host provide should be able to help you gain access to the backups of the file system and of the database, if you don't have direct access yourself and/or you don't have a separate backup available.
> 4 votes

---
Tags: pages
---


title: Freeform field data on success page

text:
# Question
Title: Freeform field data on success page
I'm trying to display some user entered data on the success/thank you page.

From http://www.solspace.com/forums/viewthread/10692/ I've got return="rsvp/success/%%entry\_id%%" and when I submit the form I end up rsvp/success/49, rsvp/success/50, rsvp/success/51, etc.

On rsvp/success I have:

```
{exp:freeform:entries entry_id="{segment_3}"}
{if freeform:no_results}<h4>Sorry, no results were found.</h4>{/if}
<h4>{freeform:field:concert_date} / {freeform:field:concert_tickets} Guests</h4>
{/exp:freeform:entries}

```

But I always get no results were found. I've tried adding dynamic="no". I've tried hard coding the entry\_id. I've even tried search:FIELD\_NAME and looking for something else in the entry. Always no results were found.

In a different area of the site, I've had use form\_id and entry\_id together to get a single entry. Does it always need both?

EE 2.7.2, Freeform Pro 4.1.3

Thanks Amanda

# Answer
> 2 votes
Yes, you need to add the form\_id parameter so freeform knows which table to lookin for hte entry\_id. Each form gets it's own table to store data in.

---
Tags: solspace-freeform
---


title: Relating to future dated entries

text:
# Question
Title: Relating to future dated entries
I've added a Relationships field to a Channel, which allows the current entry to be related to another Channel that contains events, however events that are going to take place in the future do not appear in the list of events that are available to link to.

So I can't relate to future dated entries.

Is there any way around this?

# Answer
> 4 votes
Make sure that in the settings for your Relationship custom field that you have checked the box for "Include in selection *Future entries?*"

---
Tags: relationships, related-entries
---


# Question
Title: Display a List of Events with "Month Year" Headers with Low Events
We have a channel with events in it, and are utilizing Low Events. The design calls for a list of events, with Month Year as a heading, such as this:

**January 2014**

* Event 1 Details
* Event 2 Details

**February 2014**

* Event 3 Details
* Event 4 Details

... and so on.

I suspect I need to compare the month/year of entry i with that of entry i-1; if they're not the same, display the month/year of entry i. What's the best way of doing that?

It looks like EE has a native tag pair for handling this, {date\_heading display="monthly"}, but that appears to be based on the entry\_date, and not the value of my Low Events field. It appears that Low Events has the ability to sync the date of the events field with the entry\_date, but would prefer to keep them unrelated if possible.

# Answer
Try using the :first modifier to generate those headings.
> 4 votes

# Answer
If that's a Stash build, you could simply use this method for ordering entries by month and then by year (or any variation). Used it on a recent build. Works flawlessly.
> 1 votes

---
Tags: events, low-events
---


# Question
Title: Freeform - how can I make the recipients select field required?
I have a freeform form with a select field allowing the user to select from 5 possible recipients. I do not want to have any of the recipients selected by default - the user must select one. I would like the recipient select field to be a required field. So, if the user does not select a recipient, an error message will be displayed.

I've seen that other people have done it the way I have, so I'm assuming I've used the right method, but for some reason it doesn't work. If I leave the select field empty, the form will still submit (but obviously not get sent anywhere because a recipient has not been selected).

My code is below. Any ideas?

```
{exp:freeform:form
  form_id="1"
  required="recipient_email|name|email|message"
  inline_errors="yes"
  form:id="enquiry-form"
  return="contact/success"
  recipients="yes"
  recipients_limit="5"
  recipient_template="enquiry_email"
  recipient1="Option 1|name@example.com"
  recipient2="Option 2|name@example.com"
  recipient3="Option 3|name@example.com"
  recipient4="Option 4|name@example.com"
  recipient5="Option 5|name@example.com"
}
  {if freeform:general_errors}
    <h2>There were some error(s) with your submission:</h2>
    <ul>
      {freeform:general_errors}
      <li>{freeform:error_message}</li>
      {/freeform:general_errors}
    </ul>
  {/if}

  <div class="row">
    <div class="col-xs-12 {if freeform:error:recipient_email}has-error{/if}">
      <label for="recipient_email">I have an enquiry about... <span class="required">*</span></label>
      <select class="form-control" name="recipient_email" id="recipient_email">
        <option value=""></option>
        {freeform:recipients}
          <option value="{freeform:recipient_value}">{freeform:recipient_name}</option>
        {/freeform:recipients}
      </select>
      {if freeform:error:recipient_email}
        <span class="help-block">Please specify the nature of your enquiry</span>
      {/if}
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12 {if freeform:error:name}has-error{/if}">
      <label class="control-label" for="name">{freeform:label:name} <span class="required">*</span></label>
      {freeform:field:name attr:class="form-control" attr:id="name"}
      {if freeform:error:name}
        <span class="help-block">Please enter your name</span>
      {/if}
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12 {if freeform:error:email}has-error{/if}">
      <label class="control-label" for="email">{freeform:label:email} <span class="required">*</span></label>
      {freeform:field:email attr:class="form-control" attr:id="email"}
      {if freeform:error:email}
        <span class="help-block">Please enter your email address</span>
      {/if}
    </div>
  </div>

  <div class="row">
    <div class="col-xs-12">
      <label class="control-label" for="email">{freeform:label:phone}</label>
      {freeform:field:phone attr:class="form-control" attr:id="phone"}
    </div>
  </div>

  <div class="row">
      <div class="col-xs-12 {if freeform:error:message}has-error{/if}">
        <label class="control-label" for="message">{freeform:label:message} <span class="required">*</span></label>
        {freeform:field:message attr:class="form-control" attr:rows="6" attr:id="message"}
        {if freeform:error:message}
          <span class="help-block">Please enter a message</span>
        {/if}
      </div>
  </div>

  <div class="row">
    <div class="col-xs-12">
      {freeform:submit attr:class="btn btn-green" attr:value="Send"}
    </div>
  </div>
{/exp:freeform:form}

```

# Answer
> 2 votes
Have you tried required="recipients|name|email|message" ?

---
Tags: solspace-freeform, solspace
---


title: prevent_duplicate_on still not working?

text:
# Question
Title: prevent_duplicate_on still not working?
Does anyone know if Freeform's prevent\_duplicate\_on="ip\_address" bug has been fixed? It's still not working for me, though I'm using 4.0.12.

Has v.4.1.3 fixed this issue?

Thanks!

Peter T

# Answer
This is still a known issue, and has not yet been fixed.
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: Text formatting in exported Freefrom entries
When exporting Freeform entries, I get a plethora of "special characters" making the data almost unusable. (I run an international association and so have more actual special characters than most. Example: acadÃ©mica a presentar tanto aportes teÃ³rico-analÃticos ) Is there a way to export data with the text formatting intact? Thanks

# Answer
> 1 votes
I just tried this and it seems to work ok for me. Do you have more details you can provide to help me duplicate this issue? Though there was no updates specifically for this in the latest version, I would also upgrade to Freeform 4.1.3 anyway. :)

Also, might be best to create a new support ticket: http://support.solspace.com/

---
Tags: solspace-freeform
---


# Question
Title: How the Heck do I turn off Comment Notifications?
I want disable comment notifications going to the admin everytime a new comment is posted...

But I can't find this setting in the maze that EE is.

How can I turn this off? Where is this setting?

# Answer
> 3 votes
You can adjust comment notifications in the particular Channel's preferences.

*Administration \> Channels \> Edit Preferences* (choose the appropriate Channel)

Then scroll down to "Notification Preferences"

EE Docs

---
Tags: comments
---


# Question
Title: Matrix: Is there a way to avoid gaps in my source code
Hopefully someone maybe able to help me with an issue I have recently discovered on a site I'm working on.

The outset is that I'm bringing through report data from a matrix field onto the page. Within said matrix is a field which defines what type of report it is, in my case its Land, Sea or Air. This field is using a radio button fieldtype to distinguish. Now in hindsight I could say use a different matrix field for each report type, but that ship has sailed unfortunately. The data is in a single matrix table and there's no going back. Putting the data into two extra matrix fields would take more time than I need to commit to this.

The problem is that when I come to display data on page, I open my matrix tag do the following

```
{report_articles}

{if report_type=="Land"}

Show the Land data

{/if}

{/report_articles}

```

This works fine and the correct data gets pulled through. However on looking at my source code, I have noticed a significant gap in my markup. My assumption is that previous rows are being brought through, their data is just not being displayed. So for example my matrix table may have 5 Land Reports, 5 Sea Reports and 5 Air Reports, and in that order too. If I try to load the Air Reports page (ie, the last few rows), it seems to pull through 10 previous rows before it, and this shows in the source code as a gap and will therefore slow down my page. My question is, Is there an easier way to approach this, or a way to avoid the impact that its having on my source code?

Any advice/help is much appreciated

# Answer
You can use Matrix's **search** parameter to return only the rows of interest:

```
{report_articles search:report_type="=Land"}
  Show the Land data
{/report_articles}

```
> 4 votes

---
Tags: matrix, pixelandtonic
---


title: Count entries with grid

text:
# Question
Title: Count entries with grid
is it possible to total count grid from many entries?

Lets say, i have 3 channel entries. Channel 1 entry 1 has 3 grid entries, channel 1 entry 2 has 5 grid entries, channel 1 entry 3 has 7 grid entries.

The result should be 15. Also show beside the grid entries the number 1, 2, 3, ... 15

Thanks

# Answer
> 1 votes
This can be done a couple of ways. 1 - manually! enable PHP in the template and doing it that way.

2 - addon, i have used one before that i cannot quite track down now... but something like TALLY should do the job, try playing over at devot-ee: http://devot-ee.com/add-ons/tally

I might have even created a simple plugin myself to do this in the past. I truely cannot remember. But there is certainly options out there on devot-ee.

# Answer
> 1 votes
In 2.7.3 there are variables within grid, see http://ellislab.com/expressionengine/user-guide/modules/channel/grid.html#variables

```
{fieldname:count} //the current row being displayed
{fieldname:field_row_count} //how many rows are in the grid
{fieldname:total_rows} //the rows being returned by the query

```

---
Tags: grid, count
---


title: WYGWAM Content Templates Blank

text:
# Question
Title: WYGWAM Content Templates Blank
I've successfully used WYGWAM (CK Editor) Styles before but I cannot get the Templates to work. I have a relative path in my WYGWAM settings like so:

And I'm just getting this:

I have the following code in my "wygwam\_templates.js" file:

```
    // Register a template definition set named "default".
CKEDITOR.addTemplates( 'default',
{
// The name of the subfolder that contains the preview images of the templates.
//imagesPath : CKEDITOR.getUrl( CKEDITOR.plugins.getPath( 'templates' ) + 'templates/images/' ),

// Template definitions.
templates :
    [
        {
            title: 'Insert Location Map',
            description: 'Using this will add the interactive map to this page',
            html:
                '<img src="/images/layout/locations_map.jpg" usemap="#locations" />' +
                '<map name="locations" id="locations">' +
                    '<area id="corporate" shape="rect" coords="46,97,170,136" href="#" />' +
                    '<area id="brazil" shape="rect" coords="207,246,257,277" href="#" />' +
                    '<area id="uruguay" shape="rect" coords="202,299,265,324" href="#" />' +
                    '<area id="germany" shape="rect" coords="293,76,354,105" href="#" />' +
                    '<area id="italy" shape="rect" coords="350,102,392,119" href="#" />' +
                    '<area id="india" shape="rect" coords="478,158,524,178" href="#" />' +
                    '<area id="china" shape="rect" coords="551,140,595,163" href="#" />' +
                '</map>'
        }

    ]

```

});

I love the ideas of the Templates but for the life of me I can't get it to work. Any help would be great!

I'm using EE 2.72 and Wygwam 3.2.1

# Answer
Okay you must set "template\_files" to reference your JS file. You also must update your CKEditor JS files as seen here: http://get-simple.info/forums/showthread.php?tid=1976
> 1 votes

---
Tags: wygwam
---


title: Blog + Pagination?

text:
# Question
Title: Blog + Pagination?
Still new to EE, and am quickly losing my hair trying to get a blog going, and getting it paginated correctly.

The problem I'm having is that the pagination links move in increments of 6, /news/P6, /news/12 etc....

I've tried removing all the code except for the Title and the "Read More..." link, and pagination still has the same issue.

*** EDIT ***

I'm also looking to have only 6 entries per page, so that the next page will have the next six entries etc... 6 entries are currently showing on the /news page - which is good. The site has something like 40 entries, but I just want to paginate so only six entries show at a time.

*** /EDIT ***

Any help would be appreciated!

Here is my code:

```
<ul class="news">
                {exp:channel:entries channel="news" limit="6" dynamic="no" orderby="date" sort="desc" paginate="bottom"}
                  {paginate}

                      <p id="pagination">Page {current_page} of {total_pages} pages {pagination_links}</p>
                    {/paginate}

                            <li>
                                <div class="pic">
                                    {if image !=""}<a href="{url_title_path='news'}"><img src="{image}" alt="{title}" /></a>{/if}
                                </div>
                                <div class="details">
                                    <h5>{title}</h5>
                                    <p>{if "{content:has_excerpt}"}{content:excerpt}{if:else}{content}{/if}
                                    </p>
                                    {if video_embed != ""}{video_embed}{/if}
                                     {if slideshow}
                                    {slideshow limit="10"}<a href="{comment_url_title_auto_path}" style="float:left;">{exp:ce_img:pair src="{url}" max="100" crop="yes"}<img src="{made}" alt="{title}" />{/exp:ce_img:pair}</a>{/slideshow}
                               {/if}
                                    <a href="{comment_url_title_auto_path}" style="clear:all;">Read More...</a>
                                </div>
                            </li>
                {/exp:channel:entries}

                        </ul>

```

# Answer
> 2 votes
The code you posted is correct for what you're wanting to achieve.

```
{exp:channel:entries channel="news" limit="6" dynamic="no" orderby="date" sort="desc" paginate="bottom"}

```

This code will get you 6 entries per pagination page and your pagination URLs will increment by 6 because you have `limit="6"` set. If you change that to `limit="10"`, you still see 10 entries per page and URLs that increment by 10.

# Answer
> 1 votes
You have a `limit="6"` so your paginated urls will be in increments of 6. What you have working correctly.

The `P6` in the url is basically an offset count so EE knows which entry in the count/order to begin with. `P6` will start with entry 7 in your determined order.

---
Tags: pagination
---


# Question
Title: Is there a maximum number of sites you can run off MSM?
I currently have MSM running 8 sites. Last week I had to create a new site and I experienced a whole host of issues, from addons not working as expected to show stopping database errors. It took 4 goes to get it working.

Does anyone have any experience on running more than 10 sites using MSM?

Does anyone know how I might split the main parent site into its own EE but share the content and members with other installations of EE and MSM?

Does anyone have any other suggestions?

Thanks.

# Answer
There is a hard limit of 4096 columns in a MySQL table. Each site in MSM creates additional columns in the `exp_channel_data` table: 2 columns for each custom field. If you work out how many custom fields you have, double that number and divide it into 4096 and round down you will end up with an approximate maximum for the number of sites that is possible:

```
Maximum no of sites = 4096 / [No of custom fields] * 2

```

Note that other factors can effect the maximum number of columns permissable, such as the total allowed row size in a MySQL table (65,535 bytes) \[1\]

For this reason, MSM is not really a scalable solution to the problem of multiple sites which share data. You might be better off sharing data with a parent/base site via an API \[2\].

Alternatively, you could investigate assigning fieldgroups created in site 1 to channels created in site X, so that those database columns are reused rather than duplicated. This can be done by manually editing the field\_group value assigned to a channel in the `exp_channel` table. Surprisingly, the CP publish/edit forms work as expected with this change. However, I haven't investigated how this would impact tags used in front-end templates.

\[1\] http://dev.mysql.com/doc/refman/4.1/en/column-count-limit.html
\[2\] http://docs.eeopenapi.apiary.io/
> 6 votes

# Answer
In short no... but EL has always recommended you keep it below 100. From memory at least. Considering the way the channels and fields tables are setup - i am thinking it would hit that database hard pretty hard running too many. So you would probably end up paying for high end hosting as a compromise.
> 1 votes

---
Tags: multi-site-manager
---


title: Stash output in xml template

text:
# Question
Title: Stash output in xml template
I have a xml template with an embedded stash xml partial. But I'm not getting any output.

This is my xml:

```
{stash:embed:viewmodels:categories process="inline" stash:entry_id="{entry_id}"}
    <category_sport_name_ms>
    {exp:stash:get_list name="export_categories" match="#sport#" against="type"}
    <str><![CDATA[{name}]]></str>
    {/exp:stash:get_list}
    </category_sport_name_ms>

```

And this is my viewmodel categories.xml (also tried html)

```
{exp:stash:set_list name="export_categories" parse_tags="yes"}
{exp:gwcode_categories group_id="2" entry_id="{stash:entry_id}" style="linear"}
    {stash:type}sport{/stash:type}
    {stash:name}{cat_name}{/stash:name}
    {stash:id}{cat_id}{/stash}
    {stash:color}{cat_description}{/stash:color}
    {stash:url}{cat_url_title}{/stash:url}
{/exp:gwcode_categories}
{exp:gwcode_categories group_id="1" entry_id="{stash:entry_id}" style="linear"}
    {stash:type}age{/stash:type}
    {stash:name}{cat_name}{/stash:name}
    {stash:id}{cat_id}{/stash:id}
    {stash:url}{cat_url_title}{/stash:url}
{/exp:gwcode_categories}
{exp:gwcode_categories group_id="3" entry_id="{stash:entry_id}" style="linear"}
    {stash:type}theme{/stash:type}
    {stash:name}{cat_name}{/stash:name}
    {stash:id}{cat_id}{/stash:id}
    {stash:url}{cat_url_title}{/stash:url}
{/exp:gwcode_categories}

```

{/exp:stash:set\_list}

Even if I remove the set list and just enter something like test there is still no output? Is xml unsupported? Thanks!

# Answer
> 3 votes
You're essentially using the embed as a snippet, so you could do this:

```
{!-- viewmodels/categories.html - include the code but don't parse --}
{stash:embed:viewmodels:categories process="start" parse="no"}
<category_sport_name_ms>
{exp:stash:get_list name="export_categories" match="#^sport$#" against="type"}
<str><![CDATA[{name}]]></str>
{/exp:stash:get_list}
</category_sport_name_ms>

```

In viewmodels/categories.html, just use `{entry_id}` instead of `{stash:entry_id}`.

You also need to ensure that your list columns are consistent for every row. That means you must use the same column names for each of your three uses of `gwcode_categories`:

```
{stash:type}sport{/stash:type}
{stash:name}{cat_name}{/stash:name}
{stash:id}{cat_id}{/stash}
{stash:color}{cat_description}{/stash:color}
{stash:url}{cat_url_title}{/stash:url}

```

(Leave the value empty if it doesn't exist)

---
Tags: stash, xml
---


title: P&T Checkboxes and Channel Form

text:
# Question
Title: P&T Checkboxes and Channel Form
I am having trouble displaying checkboxes for a P&T Field Pack Checkboxes custom field in a Channel Form (ExpressionEngine 2.7.1, Field Pack 2.1.1) using the {custom\_fields} and {options} loop.

I've simplified this example, but using the following code nothing is displayed.

```
{custom_fields}
  {if field_name=='preferred_position'}
    {options}
      {option_name}
      <input
        type="checkbox"
        name="{field_name}[]"
        value="{option_value}"
      >
    {/options}
  {/if}
{/custom_fields}

```

And the corresponding Field Options:

```
1 : Driver
2 : Cook
3 : Bartender

```

In earlier versions of EE (back when it was Safecracker), my loop looked like this:

```
{preferred_position:options}
  {option_name}
  <input
    type="checkbox"
    name="preferred_position[]"
    value="{option_value}"
  >
{/preferred_position:options}

```

Are the P&T fieldtypes unsupported by {custom\_fields}?

# Answer
> 4 votes
Any time i've used it P&T fields so far i've gone with this syntax:

```
{field:preferred_position}

```

I haven't specifically used checkboxes, but I think its worth a shot.

---
Tags: custom-fields, channel-form, field-pack
---


# Question
Title: Scheduling / rotating images on a daily basis
I have an area on my homepage for an image. I would like this image to change on a daily basis.

I would like to queue up images so they are ready.

I know i could set a channel for these images and schedule them via expiring etc, but I was thinking there must be an easier way!

Any ideas?

# Answer
> 4 votes
Another simple idea... Name your images like this:

```
December-1.jpg
December-2.jpg
December-3.jpg

```

Manually upload the images to the server... in your template call image like this:

```
<img src="/path/to/images/{current_time format="%F-%j"}.jpg">

```

The image for the current day will always be called.

---

EE date formatting options are here:
http://ellislab.com/expressionengine/user-guide/templates/date\_variable\_formatting.html

# Answer
> 6 votes
Your option is a good one and not hard at all.

Instead of expiring the entries, I would future date them and set limit="1" on your channel:entries tag. This way an entry will always appear. With expiring you risk human error causing an image not appearing.

# Answer
> 3 votes
If you don't want to use channels, use low variables with a grid field with days of the week as the grid rows. Give each a file upload field and an alt field then use some logic on the template to get the day and call the low var for that day.

**Simple example, not verbatim code purely reference**

Grid field:

date\_1 | imgxx | alt title

date\_2 | imgyy | alt title

...

date\_31 | imgzz | alt title

```
{exp:low_variables:parse var="my_dates"}
{grid_field search:date_field="date_{current_time format="%j"}
<img src="{grid_field_img_column}" alt="{grid_field_alt_title}" />
{/grid_field}
{/exp:low_variables:parse}

```

# Answer
> 1 votes
Hmm, maybe this is a long shot if you want manual control, but to refresh an image once a day you could also try something like this:

{exp:channel:entries channel="images" cache="yes" refresh="1440" orderby="random"} {/exp:channel:entries}

---
Tags: channel, image
---


title: low variables / playa / matrix

text:
# Question
Title: low variables / playa / matrix
I'm stuck on something that will probably be very easy to resolve but I just don't see it anymore.

I'm using low variable to create the content of a carousel slider. For each slider the information is added in a matrix row. At the end of each row I created a playa field which fetches data from two channels to retrieve their title.

The carousel works very well and the different row's are added to the carousel and I can also retrieve the title from the playa field.

Now the issue I have is that per matrix row iteration playa loops through the total row's which results in that I get all the titles on every slide of the carousel. I would like to only get the title of the playa field defined in the matrix row of my current iteration.

It's probably a scripting error or I'm not using the tags how they should be used, so if somebody could have a peak that would be great.

Here below you'll find some screenshots.

thx, Claudio

```
<div id="sliderBlock">
    <div class="flexslider">
    <ul class="slides">
    {exp:low_variables:pair var="lv_hp_car"}
        <li><!--<a href="http://www.google.com">-->
                {exp:ce_img:single src="{hp_car_item_img}" width="781" height="443" alt="{hp_car_item_title}" crop="yes"}
            <!--</a>...-->

            {if hp_car_item_title != ""}
            <div class="flex-caption">
                {exp:playa:children var="playa_test" var_prefix="hpcar" }<h2>{hpcar:title}</h2>{/exp:playa:children}
                {if hp_car_item_type == "Exhibition"}<p class="date">{hp_car_item_start_date}  -  {hp_car_item_end_date}</p>{/if}
                <p class="description">{hp_car_item_intro}</p>
                <p class="author">{hp_car_item_credits}</p>
                <p class="imgHeader"><img src="image/backgroundTransparant.png" /></p>
            </div>
            {/if}
        </li>
    {/exp:low_variables:pair}
    </ul>

    <div id="clearFloat"></div>
</div>
</div>

```

# Answer
> 1 votes
ok now I found it! :D

```
{exp:low_variables:pair var="my_matrix"}
    {exp:playa:children var="pl"}

        {if {my_matrix:row_count} == {pl:count}}

             <h2>{pl:title}</h2>

        {/if}

    {/exp:playa:children}
{/exp:low_variables:pair}

```

---
Tags: matrix, playa, low-variables
---


title: Redirect user on post variable

text:
# Question
Title: Redirect user on post variable
I'm a novice in ExpressionEngine, but with plenty of background in PHP. Still, I'm struggling with the EE parsing order.

Here is my situation and I would be very, very thankful if anyone can give me some/any guidelines how to approach it or what I'm doing wrong.

I'm having a page that renders some content and there is a link to reveal more. The trick is that revealing that more content is password gated, but with no membership complexity.

I've got a static password (yeah, I know) that is saved as a snippet. When the user clicks to reveal more content a dialog is shown, asking for the password and then the form posts to the same page.

When the page loads it checks to see if a session variable is set and if not, sets it, then re-directs to itself (to clean up the posted values).

The page re-loads and checks for the session variable. If it is set it displays the more content, otherwise displays the link to ask for password.

Here is the snippet. I've renamed the variables, so they make more sense.

```
{exp:switchee variable="{exp:session_variables:get name='session_variable'}" parse="inward"}
  {case value=""}
    {if '{post:posted_variable}' != '' AND '{post:posted_variable}' == '{snippet_variable}'}
      {exp:session_variables:set name='session_variable' value='1'}
    {/if}
    {exp:redirectee:redirect status='302' url='{current_url}'}
  {/case}
{/exp:switchee}

... Content ...

{if '{exp:session_variables:get name='session_variable'}' == '1'}
  <p>... MORE CONTENT OF SOME KIND ... an embed/snippet even</p>
{if:else}
  <a href="#password-modal">Click here to view More Content</a>
  <div id="password-modal">
    <form action="{current_url}" method="post"><input name="posted_variable" type="password" /><input type="submit" value="Go" /></form>
  </div>
{/if}

... JS to handle the modal ...

```

My understanding is that EETemplate parses first the `{exp}` tags, then the advanced `{if}`, which made me use switchee with the `parse="inward"` attribute. I used to have it in an `{if}` conditional. Still the switchee case is not firing, and the previous setup always fired the session set and redirects.

Thanks in advance.

Third party stuff:

EDIT:

In addition to the above. I've tried extracting the top code to separate page, and the form action sends the user there, which should redirect back. It's all using switchee, which looks very complicated for such a simple thing! It still doesn't work.

```
{exp:switchee variable="{exp:session_variables:get name='session_variable'}" parse="inward"}
  {case value="1"}
    {exp:redirectee:redirect status='302' url='{last_page_visited}?status=allok'}
  {/case}
  {case default="no"}
    {exp:switchee variable="{post:posted_variable}" parse="inward"}
      {case value="{snippet_variable}"}
        {exp:session_variables:set name='session_variable' value='1'}
        {exp:redirectee:redirect status='302' url='{last_page_visited}?status=good'}
      {/case}
      {case default="yes"}
        {exp:redirectee:redirect status='302' url='{last_page_visited}?status=bad'}
      {/case}
    {/exp:switchee}
  {/case}
{/exp:switchee}

```

For some reason `{case value="{snippet_variable}"}` is never considered.

`{case default="yes"}` is the only case that is considered. Simply setting it to `{case default="no"}` breaks the page.

Any suggestions?

# Answer
Well... since noone could answer me, in time, I've resolved it with pure PHP and OO ExpressionEngine.

I'll share my code, just if anyone has similar issue or need.

As per my edit in the question area I've moved the logic in a separate page - `check_password.html` with PHP ON at the Output.

To use the following code, create a snippet variable with a given name (`snippet_variable` in my sample case), add an html form (shown further down) that posts to this page a variable with a given name (`post_variable` in my case). Then when the last\_page\_visited gets re-loaded from the redirect at the end of the code, check for the session variable (`session_variable` in my case) and show whatever you want.

```
<?php
$post_field_key = 'post_variable';
$snippet_field_key = 'snippet_variable';
$session_field_key = 'session_variable';
$session_field_value = '1'; # The value you want the session_variable set to
$bad_request_message = 'Bad request!';
$bad_data_message = 'Wrong password!';
$flashdata_key = 'error_message';

### This does what Mo Variables' last_page_visited does
if ( isset( $this->EE->session->tracker[1] ) ) {
  if ( $this->EE->session->tracker[1] === 'index' )
    $last_page_visited = $this->EE->functions->fetch_site_index( true );
  else
    $last_page_visited = $this->EE->functions->create_url( $this->EE->session->tracker[1] );
} else
  $last_page_visited = $this->EE->config->item( 'site_url' );

### This compares the posted_variable to the snippet_variable
if ( ! empty( $_POST ) && $_POST[$post_field_key] == $this->EE->config->_global_vars[$snippet_field_key] ) {
  $sid = session_id();

  ### First check if there is a session and if we can start one
  if ( empty( $sid ) ) {
    if ( ! headers_sent() )
      session_start();
    else {
      ### This is executed if a session couldn't be started
      $this->EE->session->set_flashdata( $flashdata_key, $bad_request_message );
      $this->EE->functions->redirect( $last_page_visited );
      die();
    }
  }

  $_SESSION[$session_field_key] = $session_field_value;
} else {
  ### This is executed if the page is visited without proper POST data
  $this->EE->session->set_flashdata( $flashdata_key, $bad_data_message );
}

### Always redirect back to the last_page_visited (or the index)
$this->EE->functions->redirect( $last_page_visited );
die();
?>

```

This is my partial, that renders the link (all code below goes in one page, ofc):

```
{if '{exp:session_variables:get name='session_variable'}' == '1'}
  <p>GOT THE SESSION SET CORRECTLY</p>
{if:else}
  <div class="error-message">
    {flashdata:error_message}
  </div>
  <a href="#show-modal" class="btn" data-toggle="modal">Click here to view HIDDEN CONTENT</a>
{/if}

```

And this is the modal code, but you could easily have it in-line above:

```
<div class="modal hide" id="show-modal">

  <div class="modal-body">
    <button class="close" data-dismiss="modal"><span class="visuallyhidden">Close</span></button>

    <form action="{path='path-to/check_password}" method="post">
      <div>
        <input class="span2" type="password" name="post_variable" value="" autocomplete="off" />
        <input class="btn" type="submit" value="Go" />
      </div>
    </form>

  </div>
</div>

```

Show/hide of the modal is handled by Twitter's Bootstrap.

At the end I'm still using Session Variables - http://putyourlightson.net/session-variables-plugin, but dropped the need of Mo Variables and Redirectee.

In all honesty if I'm not using EE template "code" I'm fine, but otherwise I **hate** EE with its rendering and variable injection/substitution.

That's it.
> 1 votes

---
Tags: ee2
---


# Question
Title: Thumbnails missing and not automatically generating (like they did in EE1) when we updated to EE2
We had a client whose site auto-updated to EE2 which caused it to break. One problem we're having difficulty fixing is getting images to show. Issue is not at the template level. The problem is on an entry/post level. An example is the main image on the site and in order to make it show, we had to update the field holding the filename value.

Used to be multiple filenames stored together to keep different file sizes: 3REIDenverSkylineMasthead.jpg 3REIDenverSkylineMasthead\_Thumb.jpg

Now to show masthead image we had to remove thumbnail image reference and update this field to: {filedir2}3REIDenverSkyline\_Masthead.jpg

We’re not sure how this was done before but by uploading an image in EE1, a thumbnail was generated for it automatically in EE1. Both images were displayed when looking at the entry/post in the UI. This doesn't seem to be the case in EE2 and even when we synched our upload destinations we continued to have the problem.

So our question is how can we get the images working in EE2 the way they were before on EE1. We don’t know how to get the filenames stored together to keep the different file sizes (main image, thumbnail etc.) like it was done before. We want to avoid trying to retrofit and make sure we’re making the images work the way they are designed to in EE2

# Answer
> 1 votes
There are a few ways to do this:

1. In file upload preferences you can create "image manipulations", these create resized/scaled images from the original uploaded file, useful for creating thumbs. When you upload a new image EE will create whatever variations you set up.

To call a variation into your template the syntax is {cf\_my\_image\_field:my\_variation\_name}, so if you have an manipulation called "thumb" it would be {cf\_my\_image\_field:thumb}

1. Use CEimage - http://www.causingeffect.com/software/expressionengine/ce-image This is an addon which creates sized images in your templates
2. Use two fil field on your publish page

* one field for the small/thumb image
    * one field for the large image

---
Tags: channel-entries, ee2-upgrades, channel-images
---


title: Toggle Register member check box

text:
# Question
Title: Toggle Register member check box
Upon checkout I would like to show the register member check box.

When the user clicks it I wish for a div to appear with the user name and password field.

I have working javascript, but when I insert it into the Store:Cart tag it does not work. Any ideas on getting this to work or an easier method?

````
    function register_member(checkboxName,toggleLyr) {

        var lyr = document.getElementById(toggleLyr);
        var checkbox = document.getElementById(checkboxName);

        if (checkbox.checked == true) {
            lyr.style.display = 'block';
        }
        else {
            lyr.style.display = 'none';
        }
    }

</script>

```

Register Member Account?

```
    <div id="register_member" style="display:none;">

```

Password
 {field:password}

Confirm Password
 {field:password_confirm}

Username
 {field:username}

Screen Name
 {field:screen_name}`
```
    </div></code>

```

# Answer
We've done it like this:

```
{if logged_out}
    <fieldset id="create-account">
      <legend>Create your account</legend>

      <div class="control-group">
            <div class="controls">
                <label for="register_member" class="checkbox">
                    {field:register_member}  Register Member Account
                </label>
            </div>
        </div>

    <!-- These fields are optional -->
    <div id="register_member_draw" style="display: none;">

      <div class="control-group">
        <label class="control-label" for="password">Password</label>
        <div class="controls">
          {field:password} {error:password}
        </div>
      </div>

      <div class="control-group">
        <label class="control-label" for="password_confirm">Confirm Password</label>
        <div class="controls">
          {field:password_confirm} {error:password_confirm}
        </div>
      </div>
    </div>

    </fieldset>
{/if}

```

Then the JS:

```
$(function() {
    $('#register_member').change(function() {
        if (this.checked) {
            $('#register_member_draw').slideDown();
        } else {
            $('#register_member_draw').slideUp();
        }
    });
    if ($('#register_member').is(':checked')) {
        $('#register_member_draw').show();
    }
});

```
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Pagination {auto_path} outputting 3 x duplicate URL
I have an odd problem with EE 2.5.3 outputting multiple urls preceding the correct pagination segment when using this code:

```
{paginate}
{if next_page}
<a href="{auto_path}"Next</a>
{/if}
{/paginate}

```

It outputs the following: `http://www.domain.co.uk/http://www.domain.co.uk/http://www.domain.co.uk/news/P6`

Interesting, if manually navigate to `http://www.domain.co.uk/P6` (or P0) then it then outputs the correct link - it is only when there is no pagination segment in the url that it does not work.

If I change the setting "URL to the root directory of your site" in the general config from `http://www.domain.co.uk/` to just `/` then it works and outputs the correct link. However, this causes other problems with sitemaps and so on, so it's not an ideal solution.

The name of the site's index page is left blank as I am using rewriting to remove the index.php from the urls.

There is nothing that I can see in the config files that would be adding an additional two `http://www.domain.co.uk`s to the output.

If it might be relevant, the site is using EEHarbour's Transcribe plugin (a pre-release beta of 1.6) and Structure 3.3.13 and Freebie 0.2.2

Hope someone can help!
Many thanks, Michael

# Answer
> 1 votes
Right, I've solved this by adding `paginate_base="news"` into the channel:entries tag and it works correctly now.

I have no idea why it was broken in the first place though!

---
Tags: url, config, transcribe, pagination
---


# Question
Title: Can we use member_group instead of logged_in/out?
I am creating a members only section and I am wondering if I can use the member\_group variable, on its own, to check if a user is logged in or not. My assumption is that using both the logged\_in variable and member\_group variables at once creates a more resource heavy advanced conditional.

Basic example here:

```
{if logged_in AND member_group == "5"}
    logged in content (member group 5 view)
{if:else}
    logged out content (public view)
{/if}

```

However, if users are not a part of any member group I create, or they are not a super admin, then they default to the Guest member group 3. This represents anyone not logged in. At least that is how I understand it.

But if EE identifies a user as belonging to any member group other than Guest, doesn't that mean they are logged in? If this is the case, then I should be able to use simple member group conditionals to check logged in status.

Does this sound right or am I missing something?

# Answer
> 3 votes
Yes, you can use `group_id` (or preferably `logged_in_group_id`) on its own - no need to include `logged_in` as well in the conditional.

---
Tags: members, conditionals, advanced-conditionals
---


# Question
Title: Relationships: getting parent from parent
We have 3 channels called chapters, districts and groups. Channel chapters has a multiple relationship field for districts, channel districts has a multiple relationship field for groups, channel groups has all the groups.

We assign members to groups.

At a point (when a member logs in) we know the group and like to know what district and what chapter are assigned.

In our test here we are putting an entry\_id in the group channel to get a certain group out. And then we get the district with the first parents tag.

But the second parents tag for channel chapter does not work.

How would we get the chapter then? Would we need an embed or ...?

Thanks for some advice.

```
{exp:channel:entries
   channel="gruppen"
   entry_id="1"
}

  {parents field="gruppen"}
      Bezirk (district): {parents:title}
      {!-- The following doesn't work --}
      {parents channel="bereiche" field="bezirke"}
            Bereich (chapter): {parents:title}
      {/parents}
  {/parents}
{/exp:channel:entries}

```

# Answer
You can actually accomplish this by further namespacing the Relationship tag pairs:

```
{exp:channel:entries channel="gruppen" entry_id="1"}
  {parents field="gruppen"}
      Bezirk (district): {parents:title}
      {parents:parents channel="bereiche" field="bezirke"}
            Bereich (chapter): {parents:parents:title}
      {/parents:parents}
  {/parents}
{/exp:channel:entries}

```
> 2 votes

---
Tags: relationships
---


# Question
Title: Postmaster Parcel submitting to localhost
Whenever I try and save a Parcel I created, the form just returns to localhost. I am not working locally, so I am not sure why it would go to that.

I am using:

EE 2.7 Postmasger 1.4.3

I also have the latest Matrix, Assets and Zenbu installed.

# Answer
> 1 votes
Postmaster uses front-end actions to save parcels, and it gets the URL for that action from your site preferences. Check the value of **URL to the root directory of your site** (found under **Admin → General Configuration**) - my guess is that it's still set to `localhost` from when you were in development.

---
Tags: postmaster
---


title: Can you use Wygwam within Grid field?

text:
# Question
Title: Can you use Wygwam within Grid field?
My question is pretty straight to the point. I want to use WYGWAM as a data type within the Grid field, but it doesn't give me the option to select it? Anyone know if this is possible? I know it can be done within Matrix, but if I can just use the native Grid field, I'd prefer that.

# Answer
**UPDATE**

As of March 12, 2014 (Wygwam 3.3 release), Wygwam is compatible with Grid (you can Wygwam as a Grid cell type).

It looks like Wygwam is not compatible with Grid. The add-on page on devot:ee indicates no Grid compatibility and in a test I'm not able to do this with the latest versions of EE and Wygwam (2.7.3 and 3.2.2, respectively).
> 0 votes

# Answer
It's not possible. You can use expresso, it is compatibal with Grid.
> 0 votes

---
Tags: wygwam
---


title: Check if a template group exists

text:
# Question
Title: Check if a template group exists
Is there a way to check if a template group exists either in the templates or in a add-on?

For example, I would want to do something like this

```
{if {exp:foo:template_exists name="blog/test"} == "true"}
    {embed="bar/qux"}
{if:else}
    {redirect="404"}
{/if}

```

# Answer
> 1 votes
As far as i'm aware this functionality is built in by default, if there is no template then it'll automatically 404 error.

Please see the ExpressionEngine URL Schematic here: http://www.jamessmith.co.uk/images/ExpressionEngine\_url\_schematic.png

# Answer
> 0 votes
As other have said, this is built in by default. Have a look at this article by Jovia Web Studio if you want to implement a more stringent 404 policy on your site. Comment are interesting as well.

# Answer
> 0 votes
What you are trying to do should be done using an Ajax function. Something like this:

```
$.ajax({
    type: 'HEAD',
    url: 'http://www.example.com/template_group/',
    success: function() {
        alert('Page found.');
    },
    error: function() {
        alert('Page not found.');
    }
});

```

If there's an error, redirect to your 404 page.

---
Tags: templates, 404, template-scripting
---


# Question
Title: how to use a custom image instead of generated submit button
Freform PRO - 4.1.3 I'm using the tag {exp:freeform:form}

How do i reference my custom image instead of the generated button?

Thanks

# Answer
You don't have to use the `{freeform:submit}` variable.

* You could use `<input type="submit" />` and style it with CSS to use a background image.
* Or use `<button type="submit"><img src="mybutton.png" /></button>`
* Or `<input type="image" src="mybutton.png" />`
> 6 votes

---
Tags: solspace-freeform
---


# Question
Title: Moving channel fields to different group?
I am using the Brilliant Retail e-commerce plugin and currently I have a Channel Group, "Bikes," with 8 channel fields associated with it. I would like to move all those channel fields to a different group, "\[BrilliantRetail\]," is this possible?

I know I can edit Channel Group assignments and tell the BrilliantRetail group to use the Bikes channel fields, but I already have some custom channel fields in the BrilliantRetail group as well so I would like to just merge the Bikes channel fields with the BrilliantRetail group.

**UPDATE** I edited the database and changed the channel fields group\_id to the one corresponding to BrilliantRetail group and that worked. However, the channel field data did not transfer with it. Is there a way for me to re-associate the channel field data as well?

Thanks in advance!

# Answer
Can't hep you with the question in your update, but regarding your original question, I use MX Tool Box by Max Lazar when I need to move or duplicate fields. It allows you to clone fields and export/import fields from group to group.

You can work on just a single field, or a batch/group of fields at once, and it detects and allows you to solve conflics during import.

http://www.eec.ms/forums/viewthread/22/

Huge time saver for these situations.
> 1 votes

---
Tags: channel
---


# Question
Title: Bypass shipping options for downloadable products
I am building a store that sells books, but also offers subscriptions and downloads.

Currently I have the shipping calculated after the user enters their address. Once the address is entered, the user advanced to the next page with shipping options.

I would like for people who purchase non-shippable items to bypass that page.

Any Idea on how I can achieve this?

# Answer
Assuming you have already set up some shipping rules, and marked digital products as "free shipping", then Store will automatically calculate the shipping cost at $0 for orders which contain only items with free shipping enabled. If you have set up a "default shipping method", then all other orders will already have an estimated shipping cost using the default method when customers land on the shipping page.

You can use this fact to redirect customers past the shipping page when shipping has been calculated at $0. For example, in your shipping page template, use the following code:

```
{if order_shipping_val == 0}
    {redirect="checkout/continue"}
{/if}

```
> 2 votes

---
Tags: expresso-store, expresso
---