# Question
Title: index.php removal in .htaccess doesn't work when on https
I have the following htaccess setup:

```
<IfModule mod_rewrite.c>
        RewriteEngine On

        # force https for all URLs in /admin.php
        RewriteCond %{HTTPS} =off
        RewriteRule ^admin.php https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

        # Redirect index.php Requests
        # ------------------------------
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{THE_REQUEST} !/system/.*
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]

        # Standard ExpressionEngine Rewrite
        # ------------------------------
        RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

This all works great, when a user goes to /admin.php they are forced to use https and when everywhere else they just use http. However if you navigate to a front end page using the https protocol you'll get a 404 error.

Seems to be because the index.php removal technique isn't working for https, for example:

https://domain.com/page \- doesn't work https://domain.com/index.php/page \- does work

http://domain.com/page \- does work http://domain.com/index.php/page \- does work

I can't work out what I need to change to make it work when in https as, as far as I can tell there isn't https/http specified in my htaccess for the index.php removal? Any ideas would be most appreciated!

# Answer
> 4 votes
Many default SSL setup have settings to ignore .htaccess at all. So server use your .htaccess for http, but for security reason ignore default rules overwrite for https.
Check your ssl config (try - /etc/httpd/conf.d/ssl.conf) what flag you have for AllowOverride? Possible you have **None** \- in this case, the server will not even attempt to read .htaccess files in the filesystem. Change it to **FileInfo**.

# Answer
> 2 votes
Try this ::

1.) Go to your SSL configuration file : `/etc/httpd/conf.d/ssl.con`

2.) Find your Virtual Host : `<VirtualHost_default_:443>`

3.) Write down : Path to your directory

```
<Directory "/var/www/html/magento">
   AllowOverride All
</Directory>

```

4.) Restart your apache : `service httpd restart`

---
Tags: htaccess, .htaccess, rewrite, mod-rewrite
---


title: EE Channels in Structure?

text:
# Question
Title: EE Channels in Structure?
I'm running into an issue with displaying a marquee across pages on a site that has an index page and calendar page outside of Structure, while all other pages are within Structure. The code I'm trying to run in the header is:

```
<div class="demo">
 <marquee behavior="scroll" scrollamount="1" direction="left" width="350">
  <p>
   {exp:channel:entries channel="marquee" limit="3" status="open"}
     {marquee}
   {/exp:channel:entries}
  </p>
 </marquee>
<div>

```

It displays fine on /index and /calendar which are NOT the Structure pages. For every other page I can see the marquee loading however the content between the paragraph tags is blank such as:

The reason I'm wondering if this is an issue with how the templates are Structure is because when I try:
```
<div class="demo">
<marquee behavior="scroll" scrollamount="1" direction="left" width="350">
  <p>Hello, this is a test.</p>
</marquee>
</div>

```

The marquee loads as I would like it across all pages; Structure and Non-Structure.

To get around the HTML tag I'm using Remy Sharp's Marquee jquery in the footer as such:

```
  $('div.demo').marquee('pointer').mouseover(function () {
  $(this).trigger('stop');
  }).mouseout(function () {
  $(this).trigger('start');
  }).mousemove(function (event) {
  if ($(this).data('drag') == true) {
  this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
  }
  }).mousedown(function (event) {
  $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
  }).mouseup(function () {
  $(this).data('drag', false);
  });

```

as found on: http://remysharp.com/2008/09/10/the-silky-smooth-marquee/.

Any ideas of what I'm over looking here?

# Answer
Try adding a dynamic="off" parameter to your channel entries tag - though I'm not sure how this will pan out with Structure.

```
{exp:channel:entries channel="marquee" limit="3" status="open" dynamic="off"}

```
> 2 votes

---
Tags: ee2, templates, structure, javascript
---


# Question
Title: Custom fieldtype: tag pair and replace_tag_catchall()
I'm building a new fieldtype which should be used with:

* single tag:

{myfield}

...which correctly calls replace\_tag() method

* single tag with modifier:

{myfield:modifier}

...which correctly calls replace\_tag\_catchall()

* tag pair:

{myfield}{somedata}{/myfield}

...which correctly calls replace\_tag()

* but I also need tag pair with modifier:

{myfield:modifier}{somedata}{/myfield:modifier}

...which should call replace\_tag\_catchall(), but it's not calling anything.

The documentation is relatively clear that it should work.

Any idea how I can make the miracle happen?

# Answer
> 1 votes
Fieldtype tag pairs with modifiers SHOULD NOT contain the modifier in the closing tag.

Wrong:

```
{myfield:modifier}{somedata}{/myfield:modifier}

```

Right:

```
{myfield:modifier}{somedata}{/myfield}

```

---
Tags: add-on-development, custom-fields, fieldtype
---


title: Add to cart form return parameter help

text:
# Question
Title: Add to cart form return parameter help
So I have a product listing page with each product displaying having an add to cart button.

This is done like so:

```
{exp:cartthrob:add_to_cart_form entry_id="{entry_id}"}
    <input type="submit" value="Add to basket">
{/exp:cartthrob:add_to_cart_form}

```

All very well and good for a regular listing page. However this page also has a search feature, where search parameters are GET variables in the URL. Not having a return url strips the search so that is not the way forward.

So I decided to use the Mo' Variables {current\_url} tag to push in the full URL. The problem I'm having now is when I have a search query like this:

```
http://emc.dev/publications?keywords=media&category:formats=9

```

The problem here is that when CartThrob comes back it gives the message `Disallowed Key Characters.` and the url is now:

```
http://emc.dev/publications?keywords=media&category;:formats=9

```

Why is CartThrob adding a semi-colon before my colon?

Thanks in advance

Edit: I have already checked in the hidden fields in the add\_to\_cart\_form and the return url is set properly:

```
<input type="hidden" name="return" value="/publications?keyword=media&category:format=9">

```

# Answer
After a support call with CartThob I have this fixed. Turns out its actually a CodeIgniter issue (kinda). The request is basically passing through CI's XSS filter, which is picking this up as a possible XSS threat and escaping it.

The way I got around it was making a small addition to the `system/expressionengine/third_party/cartthrob/libraries/Form_builder.php` file.

Around line 714 you should see the code block

```
if ( ! $this->return)
{
    $this->return = ($this->EE->input->get_post('return')) ? $this->EE->input->get_post('return', TRUE) : $this->EE->uri->uri_string();
}

```

Which, with the addition, becomes

```
if ( ! $this->return)
{
    $this->return = ($this->EE->input->get_post('return')) ? $this->EE->input->get_post('return', TRUE) : $this->EE->uri->uri_string();
    $this->return = str_replace("category;:","category:",$this->return);
}

```

Obviously replacing "category" with whatever word(s) you are using.

Hope this sorts it for you too!
> 2 votes

---
Tags: cartthrob
---


# Question
Title: Showing entries that only have a specific category
With the category parameter in ExpressionEngine we can specify to not provide entries with a specific category `category="not 1"`

Is there a way to show entries that only have a specified category, for example: `category="only 1"`

So entries that are marked as category 1+2 will not show.

# Answer
This may be a little bit of a rough work around but it should work for you.

Then you can use the "Entry Category Count" plugin and then run a conditional inside of your entries tag like the following:

```
{exp:channel:entries channel="foo" category="1"}
    {if {exp:entry_category_count entry_id="{entry_id}"} == "1"}
        ...
    {/if}
{/exp:channel:entries}

```

Entry Category Count

On GitHub
> 4 votes

---
Tags: channel-entries
---


title: Wyvern and CKEDITOR

text:
# Question
Title: Wyvern and CKEDITOR
We're trying to get Wyvern/CKEDITOR to show up on our dashboard that we created. It shows up beautiful in the control panel, just not the dashboard. We've been scouring the web for clues or hints of code to point us in the right direction. When ee-rte is selected, it works beautifully on the dashboard. Just not Wyvern!

I've tried {field:mission} (thanks to Brian Litzinger) which got us some what closer. But we're stuck yet again. Posted below is a picture of what is happening.

And here is the code:

```
  <div class="form-element-wrapper" id="mission-container">
    <label for="mission">Mission</label>
      <textarea name="fife" id="fife" rows="12" styles="width:100%;">
        {field:mission}
      </textarea>
  </div>

```

I've linked the ckeditor.js. I've even tried CKEDITOR.replace (which is why the id and class say 'fife' still). I've done about almost every combination my brain can think of. What are we missing? Any help or suggestions will be extremely helpful! Thank you everyone for your time.

**EDIT 1:** {field:mission} *does* render textarea in *source*, just does *not* display. Here is what we see.

```
<textarea style="margin-top: 30px; height: 200px; visibility: hidden;" class="wyvern" id="mission" name="mission">mission text here</textarea>

```

**EDIT 2:** We figured it out: It was an issue with how we had the segments set up. Once we changed everything to a more simpler segment layout, it worked perfectly. {field:mission} DOES properly render the textarea and DOES display the editor beautifully now on the front end. Thanks for the help, Brian.

# Answer
> 1 votes
Try just:

```
 <div class="form-element-wrapper" id="mission-container">
    <label for="mission">Mission</label>
    {field:mission}
  </div>

```

{field:mission} will render the textarea for you.

---
Tags: channel, fields, rte, wyvern, ckeditor
---


# Question
Title: Comment Variables not working after EE 2.8.1 upgrade
We are in the process of upgrading from EE 2.7.3 to 2.8.1 and during testing we have found several variables that are not working or parsing after the upgrade. Specifically, `{gmt_comment_date]` and `{total_comments}`. Total comments seems to always return '0' and `{gmt_comment_date]` doesn't parse, just returning a result like this:

```
{gmt_comment_date format='%D, %d %M %Y %H:%i:%s %O'}

```

To test things I created the following code block on my single entry page:

```
{exp:comment:entries sort="asc" orderby="date" paginate="bottom" channel="tmo_articles" paginate_base="tmo/article"}
    TOTAL COMMENTS: {total_comments} <br/>
    {gmt_comment_date format='%D, %d %M %Y %H:%i:%s %O'}
{/exp:comment:entries}

```

The results looked like this when I viewed them:

```
TOTAL COMMENTS: 0
{gmt_comment_date format='%D, %d %M %Y %H:%i:%s %O'}
TOTAL COMMENTS: 0
{gmt_comment_date format='%D, %d %M %Y %H:%i:%s %O'}
TOTAL COMMENTS: 0
{gmt_comment_date format='%D, %d %M %Y %H:%i:%s %O'}

```

Other variables do seem to work fine. `{comment_date}` works in the same code without issue. Also If I use `{comment}` the comments themselves are displayed without issue. I checked the documentation for the Comment module and it still shows all these variables as valid. Does anyone know why just these specific variable aren't parsing properly anymore?

# Answer
> 1 votes
Just closing the loop. I did file a bug report here and it was accepted.

---
Tags: upgrade, comments, 2.8
---


# Question
Title: Does Cartthrob Gift Certificates exist anymore?
Does this plugin exist? If not, does anyone know of any alternatives besides coding our own?

# Answer
> 3 votes
We ran into something similar with one of the CartThrob listed payment processors. It was listed in the docs, but the processing files were missing for that specific gateway. We reached out to CartThrob support and were emailed the missing files 24 hours later. This sounds like a similar situation so you may try to set up a support call with them directly.

# Answer
> 0 votes
I'm afraid I don't have a particularly positive answer...

The "Buy" button on the documentation now goes to a blank page and there are no mentions of it on the main Cart Throb website. I think you can consider this one dead.

Because has CartThrob included first-party gift certificates since 2012 it looks as though there was never much demand for a third-party solution and so there doesn't seem to be any alternatives on the market.

A popular alternative to CartThrob, Exp:resso store doesn't have gift certificate support either at time of writing, although it is a candidate on the "Feature Requests" voting page at https://exp-resso.com/support/feature-requests.

Brilliant Retail doesn't have gift card support either (unless you want to make single-use coupon codes manually - in which case all 3 of these platforms should accommodate).

Unfortunately ExpressionEngine can be a bit lackluster when it comes to eCommerce websites. Typically it works well for sites with a few products and very basic functionality but when you introduce advanced digital products, certificates, delivery tables, tax tables it lags behind other solutions such as Magento or Shopify.

---
Tags: cartthrob, giftcertificates
---


# Question
Title: If else condition involving contains on url-title?
I have an event block that displays images.

I want to have 3 options: \- if event has image, display that image \- if event url title has a certain keyword, display that image \- else display a placeholder image

I don't know how to write the 2nd option to the existing code:

```
    {if event_photo}
        {exp:imgsizer:size src="{event_photo}" alt="{title}" width="300" height="450" class="displayBlock" quality="100"}
    {if:else}
        <img src="/images/_pages/_global/placeholder.jpg"/>
    {/if}

```

# Answer
> 1 votes
You need some RegEx for that.

Using the new conditionals operators of EECMS version 2.9:

```
{if event_photo}
    {exp:imgsizer:size src="{event_photo}" alt="{title}" width="300" height="450" class="displayBlock" quality="100"}
{if:elseif url_title *= "keyword"}
    {exp:imgsizer:size src="{other_photo}" alt="{title}" width="300" height="450" class="displayBlock" quality="100"}
{if:else}
    <img src="/images/_pages/_global/placeholder.jpg"/>
{/if}

```

Using switchee, if you can't update EECMS:

```
{exp:switchee variable="{event_photo}/{url_title}" parse="inward"}
    {!-- if the concatenation of both variables ends on "/", but has something before it --}
    {case value="#./$#"}
        {exp:imgsizer:size src="{event_photo}" alt="{title}" width="300" height="450" class="displayBlock" quality="100"}
    {/case}

    {!-- if there is "keyword" --}
    {case value="#keyword#"}
        {exp:imgsizer:size src="{other_photo}" alt="{title}" width="300" height="450" class="displayBlock" quality="100"}
    {/case}

    {case default="yes"}
        <img src="/images/_pages/_global/placeholder.jpg"/>
    {/case}
{/exp:switchee}

```

---
Tags: url, url-title, ifelse
---


# Question
Title: DevDemon Updater: An upload error occured. CODE: 1
While uploading EE 2.9.0 zip file, Updater (v3.2.14) is throwing following error: "An upload error occured. CODE: 1"

Any help would be appreciated.

Thanks

# Answer
This error is saying your PHP Maximum Upload Size and PHP Max Post Size is smaller then file you are uploading. We provide a listing of your max sizes on the Upload page. Make sure they are higher then the file you are uploading.
> 1 votes

---
Tags: devdemon-updater
---


# Question
Title: Can I set a minimum number of required images for a channel images field?
I can set a *maximum* limit on the number of images a user can upload. Is there a way to set a *minimum*? I need to force users to upload 5 images, no more, no less.

# Answer
Currently Channel Images does not support this feature. You can request the feature for the future in our support portal. If you need it now, we are available for custom work as well. Feel free to contact us on the Support Portal.
> 4 votes

---
Tags: channel-images, devdemon
---


# Question
Title: Creating link from website to backside admin
For two particular (moderator) user groups, I have made a 'admin'-link that takes the user from pieces of content on the website, to the admin side - directly into the 'content-\>edit-\>entry' of that content. This to make it easier for moderators of a blog to edit certain pieces of content if necessary - without having to look for it again in the admin side.

The link I created looks something like this: http://thewebsite.com/admin.php?/cp/content\_publish/entry\_form?channel\_id=14&entry\_id=1202

This works - but the only thing is, everytime when the link is clicked the user first needs to login again (username, password) before getting into the admin part (even if the admin part is still open in a different tap). This is because in my link I miss a (presumably) salt part (which is there when I get to the edit screen using the normal admin login) - see the last part ==\> http://thewebsite.com/admin.php?/cp/content\_publish/entry\_form?channel\_id=14&entry\_id=1202&S=efdf1b4699b93656ab6cbace8816add5

how do I get / create this salt part (S=**\******), to be able to sent a user directly into the admin part of the side? (maybe after a one time login, but not for every time). It is not the same as the salt column in exp\_members.

Does anybody know what to do?

greets Rick

# Answer
starting from 2.9 there is a new variable to link to the backend. For older versions either change admin - security settings to use cookies and/or session (try if that works).

Or use a bit of code in a plugin or extension to make the session\_id available to the template. See linking to admin from the main site - session parameter
> 0 votes

# Answer
You need to set the admin session type to "Cookie Only" - this will remove the S=\**** part of the URL.

Read up on how to change this setting + implications of changing it here: http://ellislab.com/expressionengine/user-guide/cp/admin/security\_settings.html
> 0 votes

---
Tags: members, admin
---


# Question
Title: How does exp_channel_data table allocate it's primary key?
I am working on a site with EE where the client is having some of the data pushed into to the MySQL database from a external FilemakerPro database. I'm working with an external company who handle the clients database for them and in order to push the data through they need to know how the exp\_channel\_data table allocates it's primary key. Apparently looking at the setting in MySQL, it's the only pertinent table which doesn't do it automatically.

Could anyone shed any light on this? Many thanks.

# Answer
> 1 votes
The primary key for entries are generated in the exp\_channel\_titles table. When the entry is created the data first goes there and then it inserts into the exp\_channel\_data table using the same key.

Edit: In Api\_channel\_entries.php these two functions are called:

```
ee()->db->insert('channel_titles', $meta);
$this->entry_id = ee()->db->insert_id();

```

ee()-\>db-\>insert\_id() is a link to code igniter's mysql function that is a call to the php function mysql\_insert\_id() (or your other types of databases' function call). After that call in api\_channel\_entries, it uses that id to insert all the data into the channel entries table.

---
Tags: database, mysql, table
---


title: Inbuilt search and relationship field

text:
# Question
Title: Inbuilt search and relationship field
Does the inbuilt search search through the relationship fields?

I am using `simple_form`

# Answer
No, the Search module will *not* look in any related entries when determining if your search terms match a particular entry.
> 1 votes

---
Tags: relationships, search
---


title: Moving site to a new server

text:
# Question
Title: Moving site to a new server
Whats the deal to moving a site to a new server? I saved all of my templates as files. And I have datagrab so I can import the entries. I've also grabbed all the plugins.

But do I have to recreate the whole internal structure of the site (channels, fields, etc.)? If so OMG...

# Answer
> 2 votes
No, you should just have to move your Database and template files to the new server.

---

MODERATOR EDIT

**LINK TO EE DOCS**
Moving ExpressionEngine to Another Server

# Answer
> 0 votes
after trying everything, i blew away the files and reuploaded. now all works.

---
Tags: server-migration
---


# Question
Title: Is Cartthrob 2.6 compatible with EE 2.9.0?
Before I take the leap and upgrade to EE 2.9.0, I would like to make sure the CT 2.6 is compatible. Has anyone else had experience with this? Is it safe?

Thanks.

# Answer
> 1 votes
Updated today and did quite a lot of testing. No issues so far. They mentioned they'd been using it with the 2.9 preview.

---
Tags: cartthrob, ee2-upgrades
---


# Question
Title: Cartthrob plugin for email notifications based on custom field
I found a plugin on the following site http://becordial.co.uk/expressionengine-cartthrob-email-notification-dynamic-custom-field/ which I have uploaded but does not show up in the extensions list so cannot install. Using EE 2.7.2

Any ideas why it is not showing up?

```
EE =& get_instance();
    $this->settings = $settings;
    }

    public function activate_extension()
    {
        $this->EE->db->insert(
            'extensions',
            array(
            'class' => __CLASS__,
            'method' => 'cartthrob_on_authorize',
            'hook'  => 'cartthrob_on_authorize',
            'settings' => '',
            'priority' => 10,
            'version' => $this->version,
            'enabled' => 'y'
            )
        );

$this->EE->load->add_package_path(PATH_THIRD.'cartthrob/');
$this->EE->load->library('cartthrob_loader');

$this->notification_events = array('custom_field_event');
$this->module_name = "Cartthrob_customfield_notification";

if (!empty($this->notification_events))
{
    $this->EE->db->select('notification_event')
            ->from('cartthrob_notification_events')
            ->like('application', ucwords($this->module_name), 'after');

    $existing_notifications = array();

    foreach ($this->EE->db->get()->result() as $row)
    {
        $existing_notifications[] = $row->notification_event;
    }

    foreach ($this->notification_events as $event)
    {
        if (!empty($event))
        {
            if ( ! in_array($event, $existing_notifications))
            {
                $this->EE->db->insert(
                    'cartthrob_notification_events',
                    array(
                        'application' => ucwords($this->module_name),
                        'notification_event' => $event,
                    )
                );
            }
        }
    }
}

    }

    public function update_extension($current='')
    {
        if ($current == '' OR $current == $this->version)
        {
            return FALSE;
        }

        $this->EE->db->update(
            'extensions',
            array('version' => $this->version),
            array('class' => __CLASS__)
        );
    }
    public function disable_extension()
    {
        $this->module_name = "Cartthrob_customfield_notification";

$this->EE->db->delete('cartthrob_notification_events', array('application' => ucwords($this->module_name)));
    $this->EE->db->delete('extensions', array('class' => __CLASS__));
 }

    public function settings()
    {
    return $settings;
    }

    function cartthrob_on_authorize()
    {
        if ($this->EE->cartthrob->cart->order('entry_id'))
        {
            $entry_id = $this->EE->cartthrob->cart->order('entry_id');

 ee()->load->library('logger');

$this->EE->load->add_package_path(PATH_THIRD.'cartthrob/');

$this->EE->load->library('cartthrob_loader');
$this->EE->load->library('cartthrob_emails');

$this->module_name = "Cartthrob_customfield_notification";

$event='custom_field_event';

$emails = $this->EE->cartthrob_emails->get_email_for_event(ucwords($this->module_name."_".$event));

$totagb=$emails[0]['to'];

 $order_managers_field=trim($totagb, "{}") ;

 $query = $this->EE->db->select('field_id', 'field_name')
  ->from('exp_channel_fields f')
   ->where(array(
        'f.field_name'=>$order_managers_field
    ))
     ->limit(1)
  ->get();

$order_managers_field_id=0;

 if ($query->num_rows() > 0)
{

$order_managers_field_id='field_id_'. $query->row('field_id');

$email_query = $this->EE->db->select($order_managers_field_id)
  ->from('exp_channel_data d')
   ->where(array(
        'd.entry_id' => $entry_id
    ))
     ->limit(1)
  ->get();

 if ($email_query->num_rows() > 0)
{

    $this->EE->load->model("order_model");

$order_managers_email= $email_query->row($order_managers_field_id);

if (!empty($emails))
{
    foreach ($emails as $email_content)
    {

$email_content['to'] = $order_managers_email;

        $this->EE->cartthrob_emails->send_email($email_content,$this->EE->cartthrob->cart->order());
    }
}

}

}else{
ee()->logger->developer('no data returned');

}

}
    }
    // END
}
//END CLASS
```

# Answer
> 0 votes
Eventually used Postmaster and created a hook to send a custom\_field notifcation

---
Tags: cartthrob, php, extension
---


# Question
Title: Process to update an MSM site with Updater
I have a 2.5.2 MSM site that I want to bring up to 2.9. I have already updated the addons to the latest versions, but I'm not sure at what stage to update the MSM version. I've just installed Updater and can't see any reference to MSM. Do I update MSM first?

# Answer
Updating a MSM site is just like a normal EE site. Nothing is different.

Note: Updater can also update the MSM files itself, just upload the original MSM zip file.
Note 2: Be sure to make backups, Updater works almost always, but it's better to be safe then sorry.
> 1 votes

# Answer
The Updater module works for third-party add-ons. You couldn't update MSM with it. If you have latest version of ExpressionEngine, just update the MSM files of latest version.

See instruction here: Install/Update Multiple Site Manager

As you have already setup MSM, you would follow the Step 2.
> 0 votes

---
Tags: devdemon-updater
---


# Question
Title: Why are Wygwam and Editor inline styles corrupting on save
I'm using both the Wygwam and Editor plugins however on saving an entry any inline styles (such as image width and height) appear as Does anyone have any ideas?

# Answer
Do you have the “Restrict allowed HTML?” option turned on in your settings? That can sometimes remove inline styles you apply.
> 0 votes

---
Tags: wygwam, wysiwyg, editor
---


title: {if logged_in} not working?

text:
# Question
Title: {if logged_in} not working?
My frontend has a sidebar that is embedded by most of my frontend's pages. In that sidebar template, there is a conditional that goes something like this:

```
{if logged_in}
   ...
   ...
   {embed="foo/bar"}
   ...
   ...
{/if}
{if logged_out}
   ...
   ...
   ...
{/if}

```

(The `...` indicates plain HTML stuff.)

Everything works as expected -- except on my /sign-up/ page. On the /sign-up/ page, it's as if I am logged in. I see the markup inside the `{if logged_in}` conditional and the results of the embed. I do not see the markup inside the `{if logged_out}`.

Other parts of the page has similar logged\_in and logged\_out checks -- and they all seem to be working fine. The problem is isolated to just the sidebar. This is very strange to me. Any ideas what might cause this problem?

**UPDATE 1:**

Note the `{embed="foo/bar"}`. It contains a SafeCracker Registration form. Here's the opening tag:

```
{exp:channel:form
    channel="profiles"
    class="form-horizontal apply-nolazy"
    datepicker="no"
    dynamic_title="[email]"
    error_handling="inline"
    id="registration-form"
    include_assets="no"
    include_jquery="no"
    loggin_member="no"
    register_member="yes"
    return="/sign-up/verify-email-address/"
    rules:birthdate="required"
    rules:gender="required"
    rules:profile_name="required|max_length[25]"
    rules:user_provided_address="required"
    secure_action="yes"
    secure_return="yes"
}

```

When I comment out the embed, the `{if logged_in}` and `{if logged_out}` checks in the template that embeds the SafeCracker Registration form are respected. It's as if the embedding of the form causes the conditionals to misbehave. Is this somehow a problem with SafeCracker Registration Form?

# Answer
> 0 votes
Have you tried an alternate combo? Rather than running 2 conditionals to check if someone is either logged in or out, trying:

```
{if logged_in}
   ...
   ...
   {embed="foo/bar"}
   ...
   ...
{if:else}
   ...
   ...
   ...
{/if}

```

# Answer
> 0 votes
You need to set the dynamic feature for this to no so that it isn't parsing any other information beyond this form through the URL. You can read about it here:

http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_entries.html#dynamic

# Answer
> 0 votes
use tag disable="member\_data" in channel form.

```
{exp:channel:form
    channel="profiles"
    class="form-horizontal apply-nolazy"
    datepicker="no"
    dynamic_title="[email]"
    error_handling="inline"
    id="registration-form"
    include_assets="no"
    include_jquery="no"
    loggin_member="no"
    register_member="yes"
    return="/sign-up/verify-email-address/"
    rules:birthdate="required"
    rules:gender="required"
    rules:profile_name="required|max_length[25]"
    rules:user_provided_address="required"
    secure_action="yes"
    secure_return="yes"
    disable="member_data"
}

```

i think that works for you

# Answer
> 0 votes
There are many options. Here's a fun one.

Install Mo' Variables (for free) and do this. Also, make sure template caching for the embed is turned off.

```
{if logged_in_member_id != ""}
   ...
   ...
   {embed="foo/bar"}
   ...
   ...
{/if}
{if logged_in_member_id == ""}
   ...
   ...
   ...
{/if}

```

---
Tags: templates, conditionals, safecracker-registration
---


# Question
Title: EE will not save templates as text files... No matter what
**THE PROBLEM:**

* When editing a template file via the control panel, saving it with "save template as text file" ticked gives the error: ***"Unable to save your template as a text file"***
* The template is updated in the database, but not saved out to a file
* Although the template is saved to the DB it does not reflect any changes on the actual site

**SERVER CONFIGURATION:**

**Design --\> Templates --\> Global Preferences**:

* Save Templates as Files: Yes
* Server path to site's templates: `/var/www/vhosts/serverxxx-xxx-xx-xxx.live-servers.net/hbr-new-website/system/expressionengine/templates` (I have tried this with/without trailing slash)

**Permissions**:

* `/system/expressionengine/templates` *and all subfolders and files* set as 777

**PHP settings**:

* Safe mode: off
* open\_basedir: `/var/www/vhosts/serverxxx-xxx-xx-xxx.live-servers.net/hbr-new-website/:/tmp/`
* $\_SERVER\["DOCUMENT\_ROOT"\]: `/var/www/vhosts/serverxxx-xxx-xx-xxx.live-servers.net/hbr-new-website`

Any ideas? I'm absolutely stumped :-(

# Answer
Whenever I encounter this issue, I always find it's either because of permissions or the path. If your permissions are all fine, you might double-check the path with the host, just to make sure. Doing so has cleared up this problem for me in the past (even when it seemed the path was correct).
> 1 votes

# Answer
I had problems with this also. For me it helped to create the group-folders manually. That means: If you create a template-group named "embedMe" EE will create a folder embedMe.group. Delete this folder and create it manually (certainly with 777). For me this solved the issue.
> 0 votes

---
Tags: templates, server, permissions
---


# Question
Title: Antenna: a href='http://www.site.com' works but a href='{url}' doesn't
I am using ExpressionEngine 2.8.1 with Antenna 1.26

Here is my code:

```
{exp:channel:entries channel="uploaded_videos" orderby="title" sort="asc" status="open" dynamic="no"}
          <div class="col featured-business">
          <h2><a href="{title_permalink='visit/videos/'}" class="more">{title}</a></h2>
            <div class="text">
            <p>{ee_video_url}</p>
            {exp:antenna url='{ee_video_url}' max_width="232" max_height="323" cache_minutes="0"}
            <a href="{title_permalink='visit/videos/'}"><img src="{video_thumbnail}"></a>
            {if embed_code}
            It worked! {embed_code}
            {if:else}
            No video to display here.
            {/if}
            {video_title}
            {/exp:antenna}
            </div>
            <a href="{title_permalink='visit/videos/'}" title="View" class="more">Watch Video…</a>
          </div>
          {/exp:channel:entries}

```

Within exp:antenna url='' hardcoding a youtube video url works perfectly fine. However as soon as I enter {ee\_video\_url} it doesn't work. But I have displayed {ee\_video\_url} above this within the p tags so i know it is not empty.

This is baffling me as logically it should work to remove a hardcoded url and replace it with a variable one, any help on this would be appreciated.

# Answer
> 2 votes
Solved the issue thank you everyone, I only discovered what was happening after using:

```
<a href="{ee_video_url}">{ee_video_url}</a>

```

This ended up displaying my link with added p tags like so as:

```
<p>http://www.youtube.co.uk/exampleurl</p>

```

It seems that within the channel field for the video URL, it had a default formatting of XHTML.

This needed changing to NONE and was why the channel field was automatically adding the p tags either side of the URL in browser for me. Which meant the embed didn't work.

After removing the formatting on the channel field in expression engine the embed now works perfectly.

Thank to all who answered, I will leave this up for anyone who has a future issue with this.

---
Tags: url, video, antenna
---


# Question
Title: Super Search {super_search_total_results} wrong when using start_on paramater
Like it says in the title. When using the start\_on param in the {exp:super\_search:results} tag then {super\_search\_total\_results} doesn't take into account the start\_on parameter and counts entries that should be ignored.

Short of using a second search tag with no limit and stashing {absolute\_count} is there a way to fix this so the correct total count is supplied?

# Answer
I don't think `start_on` is a parameter to `{exp:super_search:results}`. I'm pretty sure that `{exp:super_search:results}` is always an absolute count of the search results, and thus its value exists immutably when the page loads. This is why it's available within or without the tag pair.

You might be able to achieve what you're looking to do—present the number of results **you're** returning, vs what the actual **search** is returning—by doing a calculation on the `super_search_total_results` variable. Thus, `super_search_total_results - offsetValue = returnedResults`.

There are many math/calculation plugins available, but I'm partial to Math and have also used Will Hunting with good success.
> 0 votes

# Answer
Strange, start\_on is definitely working to restrict the results.

Will look into your suggestions. Temporarily I've done two searches, one to restrict the results for output (via an embed) and the other to get the count and this seems to be working - popped an `{if '{count}' == '{absolute_results}'}` and then output the count.
> 0 votes

---
Tags: solspace
---


title: Testing Extensions / Calling Hooks

text:
# Question
Title: Testing Extensions / Calling Hooks
I'm about to embark on writing a new extension for the Ecommerce module "Store" though this should relate to any extension hook. I am planning to "hook" into "store\_order\_complete\_end" in order to add in some member/user data after an order is complete.

My core question, is how can I test this extension, without having to go through actually running through creating a cart, then registering the order, faking payment, etc on the front end which will become a rather tedious task each time I want to test my code.

Is there a simple way in either EE template code, or PHP / Plugin code to "fire" a hook, to then "fire" my code if that makes sense.

Thanks

Geoff

# Answer
> 19 votes
So, when I'm doing BR related add-ons - I work in isolation a lot of the time only hitting BR once and then using Action ID's to perform the development test work.

So, first thing you're going to need to do is create your hook as normal and install an empty add-on. You'll need to do this anyway, so it makes sense to do it.

You also want to register the same function in your exp\_actions table so that you can execute the function via an ?ACT=X ID.

So, assume that $data is the array that's passed in to your extension. In the execution of the function, simply put the following in:

```
// =debug
header('Content-Type: text/plain; charset=iso-8859-1');
print_r($data);
exit;

```

*N.B: The header line simply makes the output in a humanreadable with nice formatting - it's technically not required.*

Now, you will need to make a trial purchase using the site - but then what will happen, is once it gets to that hook and executes your function and will display the $data array for you.

Now take that resulting $data and store it somewhere - at this point it doesn't matter where as long as you keep storing it.

This is where you now start the development. Normally, I'll simply set $data in the top of my function to the value that was output in my first test and then continue with development. You can keep testing the development with this same dataset, just by referencing the http://site.com?ACT=X URL which points to this function. Once you're then working, you simply substitute the $data value in the head of your function for the dynamically passed one that the hook passes and you're done.

Couple of Caveats:

* When you've finished testing, make sure you uninstall your add-on, removing the Action from the exp\_actions table and then reinstall it without that line of code in the install.
* There will be no getting over the issue that you are going to *have* to test the add-on with real data, so once you've done your initial build/tests, you'll then have to make lots of test transactions to get it to work - you're going to need to try with variety of data etc.

# Answer
> 0 votes
Also try use:

```
echo "<pre>";
var_dump($order);
echo "</pre>";
exit;

```

To print out whatever variable you want. Perfect code for debugging values at specific points in your code

---
Tags: php, expresso-store, extension, hook
---


# Question
Title: Possible to increase password expiration link from 24 hours?
I'm using EE 2.7.3 and would like to know if it's possible to increase the default expiration time (24 hours) on the outgoing link in the reset password routine.

Any help much appreciated.

Jim

# Answer
> 2 votes
No, that is not configurable. Typically, 24 hours should be sufficiently long, and any longer would start to introduce security issues. The user triggering the action is doing so to reset their password now, not some time in the future (or shouldn't be, anyway).

If an active code were to sit in their inbox for many days, for instance, that increases the chance that someone with access to that email (shared account, walking away from a desk, etc.) could intentionally or accidentally reset their password and gain control of their account.

---
Tags: password, forgot-password
---


# Question
Title: Sending An Array To EE Tag. Is It Possible?
I am very curious and very new to ExpressionEngine. Is it possible to send an array of values to an EE tag? i.e.

```
{exp:className:functionName parameter="value"}

```

Can the above parameter be of type array or can these parameters only pass single atomic values to the method?

If not, how would one be able to send arrays to a module function?

# Answer
> 1 votes
Parameters are passed into expressionengine tags as strings. I assume you are trying to pass in a php array into your parameter. In that case, you would need to refer to that particular tag's documentation to see how the values need to be passed in (e.g. pipe delimited "value1|value2" or comma delimited "value1,value2"). If you are using php, you can call the php implode function and that will return a string you can pass in.

```
<?php
$foo = array('hello', 'world', '!');
$bar = implode('|', $foo);
?>
{exp:whatever:tag data="<?=$bar?>"}

```

If you are not using php, then I believe you are thinking about the way expressionengine works incorrectly. ExpressionEngine does not produce arrays that can be used in your template that way.

If you are developing your own plugin, then you will need to do the opposite. You will need to fetch you parameter and explode it based on whatever delimiter is getting passed in.

---
Tags: ee2, module
---


title: Google Maps / Assets / Grid

text:
# Question
Title: Google Maps / Assets / Grid
I'm attempting to insert an Assets field, Grid data along with some other text input fields into a Info Box in a Store Locator page. My code is as follows:

```
{exp:gmap:results order_by="distance" sort="asc" parse="inward" cache_post="false"}
{if has_searched}
    {results}
        {exp:gmap:marker
            id="map1"
            title="{title}"
            address="{locations_address1} {locations_city}, {locations_state} {locations_zip}"
            extend_bounds="false"
            open_windows="false"
            show_one_window="true"
            clustering="true"
            duplicate_markers="false"
        }
                <div class="locations">
                    {if locations_image}{locations_image}<img src="{exp:ce_img:single src='{locations_image:url}' url_only='yes' width='708' height='396' crop='yes|center,center'}" alt="{alt_text}" class="img-responsive pull-left" />{/locations_image}{/if}
                    <div class="content">
                        <div class="title">{title}</div>
                        <p class="address">{locations_address1},{if locations_address2}<br />{locations_address2}{/if}<br />{locations_city}, {locations_state} {locations_zip}</p>
                        <p class="locations_phone"><strong>Phone:</strong> {locations_phone}</p>
                        <p class="hours"><strong>Store Hours:</strong><br />
                        {locations_hours backspace="6"}<span class="days">{locations_hours:day}</span> <span class="hours">{locations_hours:time}</span><br />
                        {/locations_hours}</p>
                    </div>

                </div><!-- end locations -->
        {/exp:gmap:marker}
    {/results}
{if:else}
<div id="locations_wrapper">
    {exp:channel:entries channel="{embed:channel}" status="not closed" sort="desc" orderby="date" disable="category_fields|member_data|pagination|trackbacks" dynamic="no"}<div class="locations {switch='pull-left|pull-right'}">
        {if locations_image}{locations_image}<img src="{exp:ce_img:single src='{url}' url_only='yes' width='708' height='396' crop='yes|center,center'}" alt="{alt_text}" class="img-responsive pull-left" />{/locations_image}{/if}
        <div class="content">
            <div class="title">{count}. {title}</div>
            {categories}{if category_url_title == 'john-atencio-store'}<div class="store_type">{category_name}</div>{/if}{/categories}
            <p class="address">{locations_address1},{if locations_address2}<br />{locations_address2}{/if}<br />{locations_city}, {locations_state} {locations_zip}</p>
            <p class="locations_phone"><strong>Phone:</strong> {locations_phone}</p>
            <p class="hours"><strong>Store Hours:</strong><br />
            {locations_hours backspace="6"}<span class="days">{locations_hours:day}</span> <span class="hours">{locations_hours:time}</span><br />
            {/locations_hours}</p>
        </div>
        <div class="clearfix"></div>
    </div><!-- end locations -->
    {switch='|<div class="clearfix"></div>'}
    {/exp:channel:entries}
</div><!-- end locations_wrapper -->
{/if}

{if no_results}
    <h2>No locations found, try another search.</h2>
{/if}
{/exp:gmap:results}

```

What's strange is that my index page works fine with the Assets and Grid. It's just the items in the `{if has_searched}{results}...{/results}{if:else}` items aren't parsing. The standard fields are working but anything that needs a tag pair to render doesn't.

I'm sure I'm missing something basic or it could be a bug too! :) Isn't everything a bug if you can't figure something out :)?

Thanks for the help on this one!

# Answer
> 0 votes
It turns out that I just had some loops in the wrong place:

```
{exp:gmap:results order_by="distance" parse="inward" sort="asc" cache_post="false"}
{if has_searched}<div id="locations_wrapper">
    {results}
        {exp:gmap:marker
            id="map1"
            title="{title}"
            address="{locations_address1} {locations_city}, {locations_state} {locations_zip}"
            extend_bounds="false"
            open_windows="false"
            show_one_window="true"
            clustering="true"
            duplicate_markers="false"
        }
        {exp:channel:entries channel="{embed:channel}" limit="1" status="not closed" sort="desc" orderby="date" disable="category_fields|member_data|pagination|trackbacks" dynamic="no"}
            <div class="locations">
                {if locations_image}<img src="{locations_image:url}" alt="{locations_image:alt_tag}" class="img-responsive pull-left" />{/if}
                <div class="content">
                    <div class="title">{title}</div>
                    <p class="address">{locations_address1},{if locations_address2}<br />{locations_address2}{/if}<br />{locations_city}, {locations_state} {locations_zip}</p>
                    <p class="locations_phone"><strong>Phone:</strong> {locations_phone}</p>
                    <p class="hours"><strong>Store Hours:</strong><br />
                    {locations_hours backspace="6"}<span class="days">{locations_hours:day}</span> <span class="hours">{locations_hours:time}</span><br />
                    {/locations_hours}</p>
                </div>
            </div><!-- end locations -->
        {/exp:channel:entries}
        {/exp:gmap:marker}
        {exp:channel:entries channel="{embed:channel}" parse="inward" limit="1" status="not closed" sort="desc" orderby="date" disable="category_fields|member_data|pagination|trackbacks" dynamic="no"}
            <div class="locations pull-left">
                {if locations_image}<img src="{locations_image:url}" alt="{locations_image:alt_tag}" class="img-responsive pull-left" />{/if}
                <div class="content">
                    <div class="title">{title}</div>
                    {categories}{if category_url_title == 'john-atencio-store'}<div class="store_type">{category_name}</div>{/if}{/categories}
                    <p class="address">{locations_address1},{if locations_address2}<br />{locations_address2}{/if}<br />{locations_city}, {locations_state} {locations_zip}</p>
                    <p class="locations_phone"><strong>Phone:</strong> {locations_phone}</p>
                    <p class="hours"><strong>Store Hours:</strong><br />
                    {locations_hours backspace="6"}<span class="days">{locations_hours:day}</span> <span class="hours">{locations_hours:time}</span><br />
                    {/locations_hours}</p>
                </div>
                <div class="clearfix"></div>
            </div><!-- end locations -->
        {/exp:channel:entries}
    {/results}
</div><!-- end locations_wrapper -->{if:else}
        <div id="locations_wrapper">
    {exp:channel:entries channel="{embed:channel}" status="not closed" sort="desc" orderby="date" disable="category_fields|member_data|pagination|trackbacks" dynamic="no"}
        {exp:gmap:marker
            id="map1"
            title="{title}"
            address="{locations_address1} {locations_city}, {locations_state} {locations_zip}"
            extend_bounds="false"
            open_windows="false"
            show_one_window="true"
            clustering="true"
            duplicate_markers="false"
        }
        <div class="locations">
            {if locations_image}{locations_image}<img src="{url}" alt="{title}" class="img-responsive pull-left" />{/locations_image}{/if}
            <div class="content">
                <div class="title">{title}</div>
                <p class="address">{locations_address1},{if locations_address2}<br />{locations_address2}{/if}<br />{locations_city}, {locations_state} {locations_zip}</p>
                <p class="locations_phone"><strong>Phone:</strong> {locations_phone}</p>
                <p class="hours"><strong>Store Hours:</strong><br />
                {locations_hours backspace="6"}<span class="days">{locations_hours:day}</span> <span class="hours">{locations_hours:time}</span><br />
                {/locations_hours}</p>
            </div>
        </div><!-- end locations -->
        {/exp:gmap:marker}
            <div class="locations {switch='pull-left|pull-right'}">
                {if locations_image}{locations_image}<img src="{exp:ce_img:single src='{url}' url_only='yes' width='708' height='396' crop='yes|center,center'}" alt="{alt_text}" class="img-responsive pull-left" />{/locations_image}{/if}
                <div class="content">
                    <div class="title">{absolute_count}. {title}</div>
                    {categories}{if category_url_title == 'john-atencio-store'}<div class="store_type">{category_name}</div>{/if}{/categories}
                    <p class="address">{locations_address1},{if locations_address2}<br />{locations_address2}{/if}<br />{locations_city}, {locations_state} {locations_zip}</p>
                    <p class="locations_phone"><strong>Phone:</strong> {locations_phone}</p>
                    <p class="hours"><strong>Store Hours:</strong><br />
                    {locations_hours backspace="6"}<span class="days">{locations_hours:day}</span> <span class="hours">{locations_hours:time}</span><br />
                    {/locations_hours}</p>
                </div>
                <div class="clearfix"></div>
            </div><!-- end locations -->
            {switch='|<div class="clearfix"></div>'}
    {/exp:channel:entries}</div><!-- end locations_wrapper -->
{/if}

{if no_results}
    <h2>No locations found, try another search.</h2>
{/if}
{/exp:gmap:results}

```

---
Tags: assets, grid, google-maps-for-ee
---


# Question
Title: Using plugin results within channel tags
I use this code using exp:math plugin:

```
{exp:channel:entries channel="planilla_de_indicadores" limit="10"}

{exp:math formula="([1] / [2]) * 100" parse="inward" params="{ps_talleres2}|{ps_talleres1}" decimals="2" absolute="yes"}

{/exp:channel:entries}

```

Here are the results:

ps\_talleres1: 50 | ps\_talleres2: 200 | Result: **25**

The problem is i need to use the result in a conditional like this:

```
{if {exp:math formula="([1] / [2]) * 100" parse="inward" params="{ps_talleres2}|{ps_talleres1}" decimals="2" absolute="yes"} >= "50"}

<span class="badge badge-warning">
{exp:math formula="([1] / [2]) * 100" parse="inward" params="{ps_talleres2}|{ps_talleres1}" decimals="2" absolute="yes"}%
</span>

{/if}

```

As expected; it doesn't work as plugin and tmp parsing order. After some google i think maybe "Pre-embed" or "stash" might help... I saw a few answers pointing to "turn plugin into a tag pair" but not sure how.

# Answer
Working

```
    {html_open}
    {html_head_end}
    {html_body}

    {embed="app_includes/header"}
     {contentpanel_open}

{exp:channel:entries channel="planilla_de_indicadores" limit="100"}

{if {exp:math formula="([1] / [2]) * 100" parse="inward" params="{ps_talleres2}|{ps_talleres1}" decimals="2" absolute="yes"} >= "50"}
    <span class="badge badge-warning">
    {exp:math formula="([1] / [2]) * 100" parse="inward" params="{ps_talleres2}|{ps_talleres1}" decimals="2" absolute="yes"}% {title}<br />
    </span>
{/if}

{if {exp:math formula="([1] / [2]) * 100" parse="inward" params="{ps_talleres2}|{ps_talleres1}" decimals="2" absolute="yes"} <= "49"}
    <span class="badge badge-danger">
    {exp:math formula="([1] / [2]) * 100" parse="inward" params="{ps_talleres2}|{ps_talleres1}" decimals="2" absolute="yes"}% {title}<br />
    </span>
{/if}

{/exp:channel:entries}

    {contentpanel_close}
    {embed="app_includes/rightpanel"}

    <!-- define custom page js (if) -->
    {html_close}

```
> 1 votes

---
Tags: parse-order, math
---


title: Solspace Friends - Friend Request Hook

text:
# Question
Title: Solspace Friends - Friend Request Hook
Is there a hook I can use when a friend request is made in Solspace Friends add-on?

After a friend request is made, I want to send a notification to the "friendee" (e.g. by email, Ajax notification, etc.).

The current list of hooks do not seem to offer me a hook that I can use.

# Answer
If it's not in the list of hooks, and no hooks are found in the Friends core files where you need one, then the hook doesn't exist.

I recommend submitting this as a Feature Request under the specific add-on category (with an explanation of why and how you would use the hook). It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. http://support.solspace.com/support/discussions
> 2 votes

---
Tags: solspace, hook, solspace-friends
---


# Question
Title: custom fields in registration form in freemember module
In Freemember module, Can we add Date of Birth and others field or calender in registration form with required field validation?

# Answer
> 0 votes
You can do it yourself by simply adding a date picker to the field. However, it won't have any validation.

If you want a more powerful solution, I suggest checking out Zoo Visitor or one of the other member management modules which allow you to use regular custom fields with your members.

---
Tags: freemember
---


# Question
Title: Exp-resso Store Orphaned Products after Channel Field Removed
**Scenario:**

* Add an Exp-resso Store Product field to an existing channel field group.
* Populate the product data for every entry in that channel.
* Delete the store custom field from the channel field group

**The Problem**

Store still thinks these products exist. They still show up in the Inventory page and the old entries (that used to have a product field) show up in all the "match product" fields for setting up discounts, etc..

**Why**

When deleting the store custom field from the channel field group, it seems that the corresponding entries in the Exp-resso Store Products database table should be deleted too, but they are not.

**Question**

Is there a way to remove a Store Custom Field from a Channel Field Group that will cause the corresponding entries in the Store Products database table to be deleted?

# Answer
> 1 votes
Unfortunately there aren't any EE hooks which run when a channel or channel field is deleted, so there is no easy way for Store to clean these up.

You could do it yourself in the database using a SQL query like this:

```
delete from exp_store_products
where entry_id not in (
    select entry_id from exp_channel_titles
)

```

---
Tags: expresso-store
---


title: Searching based on parent relationship

text:
# Question
Title: Searching based on parent relationship
I'm working on a search section of a site which allows users to find a list of shops based on their categories.

I would also like to find shops that have offers.

Offer entries have a relationship field which links it back to the shop entry.

With Low Search, is it possible to run this psuedo code?

**Give me all of the shops from category 2 that are a parent to an open offer**

# Answer
There are two filters in play here, especially if you slightly re-phrase your last sentence:

> Give me all of the shops from category 2 **and** that are a parent to an open offer

First of all, you need the **Categories filter**. And because you're just after a single category, you can use the native category="" parameter.

Secondly, you need the **Relationships filter** for the second half. This is slightly trickier. The Relationships filter, like the Categories filter, accepts IDs. With the Categories filter, you're selecting which category to filter by; with the Relationships filter, you're selecting *entries* rather than categories.

However in your case, you're not selecting entries. You're after a *pre-defined list of entries*: "open offers". So, what you're really after is a way to populate the Relationships parameter with a pipe-separated list of entry\_ids: the open offers.

Also note: you're saying "a parent to an open offer", but they way you described the relationship, *an offer is a parent to a shop*:

> Offer entries have a relationship field which links it back to the shop entry.

For the Relationships filter, you therefore need to define the parent:*field\_name* parameter, where the *field\_name* is the Relationship field in the Offers channel, and the parameter contains Offer entry IDs.

As a parameter string, it would look something like this:

```
{exp:low_search:results channel="shop" category="2" parent:field_name="1|2|3"}

```

...where `field_name` should be replaced with the actual relationship field name, and `1|2|3` is the pipe separated list of "open offer" entry IDs.
> 2 votes

---
Tags: low-search
---


# Question
Title: Images not appearing on page or in channel when edited
I am having a bit of an issue with images not displaying (I'm on EE 2.9), even though it looks as if everything is alright in the source code. The page in question is www.westeros.org/ASoWS/Gallery/

The issue also persists internally -- if I go to this channel and look at the entries, the image thumbnails do not show up in the designated field.

I just can't figure out what would be stopping them from appearing -- if I paste in any of the image urls in the source of the page, they're clearly there.

# Answer
The protocol of the images is wrong. It should be `http://`, but you're using `http:/`.

Take a look at the File Upload Preferences of the images in question. Probably the URL of Upload Directory is set wrong.
> 1 votes

---
Tags: image-galleries
---


# Question
Title: Matrix: Not able to add more than 50 rows
I am using EE v2.5.5 and Matrix v2.5.3.

In Matrix, I'm able to add up to 50 rows without problems. When I add more than 50 rows and click the Submit button, I am returned to the entry edit form again.

Is there a 50 row limit on Matrix fields?

# Answer
> 1 votes
You may already be aware of this, but you could try to switch over to Grid, the native built-in EE fieldtype. They do the same job with very little difference. And Grid might not have that 50 entry limit.

---
Tags: matrix
---


# Question
Title: Correct setup for Google Maps in multi-language site
The project I'm working on is multi-lingual, there is a large member sign-up campaign planned and it is necessary to show statistics, and ideally also a map with marker clusters, to display where the members are coming from. I've tackled the map part without a problem using Google Maps by Objective HTML but I'm running into problems trying to figure out:

1- how to have the locations translated so that, for example, in english you read New York, USA but in portuguese you get Nova Iorque, EUA.

2- what method to use so that I can display a list of all the countries which have members on the site and the number of members per country.

3- it's important to be able to search the members by region/country but I can't get the search form to work properly, do I need dedicated lat/long fields?

I suspect this all comes down to how I setup the Google Maps field type, if I have dedicated fields for lat/long and the formatted address or not. I'll be using Publisher for the translations but I'm still not sure what's the best field setup.

Also, let's say there are hundreds of markers to display on the map, the clusters take care of that visually, but how do you cope with the memory usage?

I will be using EE 2.9, Zoo Visitor for the registrations, Publisher, Low Search and Google Maps amongst others.

Thank you for your help any input is welcome!

# Answer
If the city/country is the only thing you are translating it might be easier to use a 3rd party service to translate them, such as geonames.org. e.g. http://api.geonames.org/search?name=moscow&country=RU&featureCode=PPLC&maxRows=10&type=rdf&username=demo

The demo name has reached its API limit, here is what the response looks like:
> 1 votes

# Answer
I have come up with a few solutions but I still welcome your input since these may prove to be ineffective once I test them.

1- for the translations I'll use a mixture of solutions depending on the objective of the field, for some I'll use a dedicated field for the formatted address so that the users can correct any debris that Google sends in the address, in others I'll look at the options Brian left here.

2- I came up with a solution using Low Search and its shortcuts, I'll have a shortcut to search for each country name, I can feed the country list straight to the database so no problem there. I considered using categories for each country instead of a Google Maps field but I prefer the member to enter a town on Google Maps which gives me more flexibility for other uses.

3- I've managed to make it work.

Thanks
> 0 votes

---
Tags: google-maps-for-ee, multi-language, google-maps, memory-limit, objective-html
---


# Question
Title: Error Number: 1052 Column 'site_id' in where clause is ambiguous
We are getting the above error on an intranet that is running the following code:

```
{exp:file:entries category_group="2" category="<?= $cat; ?>"}
    <tr>
        <td class="date">{entry_date format="%m/%d/%Y"}</td>
        <td class="title"><a href="{file_url}">{title}</a></td>
        <td class="description">{description}</td>
    </tr>
{/exp:file:entries}

```

We are getting the following error:

> A PHP Error was encountered Severity: Notice Message: Undefined offset: 1 Filename: database/DB\_active\_rec.php Line Number: 1724
>
> A PHP Error was encountered Severity: Notice Message: Undefined offset: 2 Filename: database/DB\_active\_rec.php Line Number: 1724
>
> A PHP Error was encountered Severity: Notice Message: Undefined offset: 1 Filename: database/DB\_active\_rec.php Line Number: 1724
>
> A PHP Error was encountered Severity: Notice Message: Undefined offset: 2 Filename: database/DB\_active\_rec.php Line Number: 1724
>
> A PHP Error was encountered Severity: Notice Message: Undefined offset: 1 Filename: database/DB\_active\_rec.php Line Number: 1724
>
> A PHP Error was encountered Severity: Notice Message: Undefined offset: 2 Filename: database/DB\_active\_rec.php Line Number: 1724
>
> A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /home/national/public\_html/system/codeigniter/system/core/Exceptions.php:170) Filename: core/Common.php Line Number: 446
>
> Error Number: 1052 Column 'site\_id' in where clause is ambiguous SELECT `exp_files`.`file_id`, `variable_name`, `variable_data` FROM (`exp_files`, `exp_global_variables`) INNER JOIN `exp_file_categories` ON `exp_files`.`file_id` = `exp_file_categories`.`file_id` INNER JOIN `exp_categories` ON `exp_file_categories`.`cat_id` = `exp_categories`.`cat_id` WHERE `exp_files`.`site_id` IN ('1') AND `exp_categories`.`cat_id` = '1' AND `exp_categories`.`cat_id` = '2' AND `site_id` = '1' Filename: libraries/Template.php Line Number: 2989

This is after an upgrade from EE 2.4 to EE 2.8.1. Not sure what to try... support hasn't responded in over 24 hours. Any help would be greatly appreciated!

# Answer
> 3 votes
Thanks for the heads up, Robson. I'm pretty sure they're running into this bug:

https://support.ellislab.com/bugs/detail/20414

It's fixed up for the next release.

Those weird queries can happen if the query cache isn't cleared out when it should be.

---
Tags: bug, files, core
---


# Question
Title: Can EE be used together with dynamic serving for mobile?
Long overdue, I am looking at trying to make my existing site more mobile-friendly. This was prompted by Google sending out their multi-screen guidelines to Adsense users, but as I went through their basic break-down of possible approaches, I found myself scratching my head quite a bit in terms of how to get this to work with EE.

Since a separate mobile site is out of the question, I am looking at either responsive design or dynamic serving. Since I suspect it would be very tricky to make my current design responsive, dynamic serving would seem like the best bet ... but I can't quite wrap my head around how that would work with EE. The guidelines talk about serving up different templates to different devices, yet somehow serving everything from a single url, but given that templates determine urls in EE that sounds like it could get very complicated? That is, I can see how to do it with the CSS, but not the actual page structure.

# Answer
> 1 votes
One way to approach this would be to use a plugin (or create a plugin) to detect whether user is coming from mobile device (via screen size or user-agent sniffing). Such plugin would provide you with conditional statements to use in your templates to render specific view.

Although, I wouldn't recommend this approach, it's an option.

Here's an example plugin: http://devot-ee.com/add-ons/mx-mobile-device-detect

---
Tags: mobile
---


# Question
Title: EE reading path variables as subfolders/subpages and giving 404 error. What am I missing?
I've got a page: /events/ that I'd like to pass year and month into: /events/2014/07/ ...and access them ({segment\_1}, etc) in the template being used for that page.

But when I go to the url http://host.com/events/2014/07, I get a 404 error because it's apparently looking for a subpage named '2014' with a subpage named '07'.

Regarding posting the code: Why? This doesn't seem to be a code-related issue because I can't even get EE to execute the code in question. The 'events' page is just my standard page template (master/standard). All the pages, for now, use one template. So, /events is using the 'master/standard' template. In it I include 'widgets/calendar' but I want to pass in {segment\_2} and {segment\_3}. EE won't let me because it doesn't go to the events page. It tries to find a page named "07" under a page named "2014" under the events page. None of this is being handled in the code yet, so I'm not sure what good it would serve to post a bunch of irrelevent EE code.

How do I tell EE to just stop at the events page and use the rest of the url as segments?I know I'm missing some basic EE logic but I'm stumped.

# Answer
> 1 votes
Probably you're getting a 404 because the `exp:channel:entries` tag is trying get all entries of the year 2014 and month 07. If you need to use years, months and days as segments, you gonna need to set `dynamic` parameter to `no`.

Take a look at the URL Schematic

# Answer
> 0 votes
If you are using the full version of expressionengine, you can use routing to change how your template handles segments. Otherwise, I believe you would need to turn strict url's off in the admin.

---
Tags: segments, path
---


# Question
Title: Return validation error to publish form from extension
I've written an extension to do some additional processing on submitted form content within the ExpressionEngine publish page, however there is a scenario where I want to return an error to the user if a value they have specified is invalid.

Is there a way to do this with an extension, some function I can call to return a validation error but retain the form input so the user isn't forced to start again?

Obviously I could just use 'show\_error' but this seems a little brutal and not what would be expected. :)

# Answer
Check out this array:

```
ee()->form_validation->_error_array

```

You can check its contents and add to it. I forget the best hook to use this in, but it might be entry\_submission\_start?
> 1 votes

---
Tags: error, extension
---


# Question
Title: displaying certain entries first based on custom field
I have a channel full of product entries. I have a checkbox custom field to mark a product as "popular". I want all "popular" products to display first in the list, like they are "sticky". But I don't want to use the default "sticky" option. Can I display all entries marked with "popular" custom field, then display the rest?

And i know I can use 2 channel entry tags, just trying to avoid it if possible.

# Answer
http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_entries.html#orderby

You can order by custom fields in the channel entries tags. It might mess up the order of the remaining entries though.
> 2 votes

# Answer
I have to do some more testing, but i think I got it with this...

sort="dsc|asc" orderby="product\_popular|title"
> 0 votes

---
Tags: custom-fields
---


title: Wyvern and Channel Forms

text:
# Question
Title: Wyvern and Channel Forms
I've been looking into creating a front-end client dashboard using wyvern, assets and of course channel forms. I have played with many configurations to get the 'dashboard' working. Specifically, everything is fine except for the channel fields that are Wyvern, just show up on the dashboard as a normal 'textarea' field in the likes of the normal rich-text editor. while in the EE control panel it shows Wyvern tools

The 'dashboard' template follows something like :

```
              {exp:channel:form channel="page" entry_id="{segment_4}" json="yes" include_jquery="yes"rte_selector=".ee-rte" toolset_id="2"}

<div class="col-lg-12">

  <div class="form-element-wrapper">
    <label for="about">About</label>
    <textarea id="about" name="about" rows="12" class="ee-rte">{about}</textarea>
  </div>

  <div class="form-element-wrapper">
    <label for="body">Body</label>
    <textarea id="body" name="body" rows="12" class="ee-rte">{body}</textarea>
  </div>

  ...etc

```

I know there's the class="ee-rte" and the rte\_selector=".ee-rte" but does this affect the Wyvern fields and possibly why I can't get Wyvern to show up in the 'dashboard' fields?

or maybe it's the:

```
    <textarea id="about" name="about" rows="12" class="ee-rte">{about}</textarea>

```

area because that's calling the "textarea", but then how do you call in Wyvern?

Any help or suggestions you may have would be awesome. I know there has to be a simple solution that I'm just completely overlooking. Thanks in advance.

# Answer
So, here's how this was fixed:

```
 {exp:channel:form channel="your_channel"}
    <div class="form-element-wrapper" id="custom-field-container">
       <label for="custom_field">Custom Field Label</label>
          {field:custom_field}
    </div>
 etc
 etc
 {/exp:channel:form}

```

:-)
> 1 votes

---
Tags: assets, safecracker, rte, wyvern
---


# Question
Title: Solspace Calendar: Showing future events - date_range_start parameter not working
I want to show future events based on today.

I currently have 3 dummy events in my system, 1 past, 1 today, 1 future. When I run the code below no events show up:

```
{exp:calendar:events event_limit="3" status="open" date_range_start="today" orderby="event_start_date" sort="asc"}

```

If I take out the parameter:

```
date_range_start="today"

```

Then all appear.

I'm running the same query for past events using:

```
date_range_end="yesterday"

```

This is working fine.

# Answer
> 0 votes
The tag you're very likely looking for is **`{exp:calendar:cal}`**, not `{exp:calendar:events}`. This is almost always the tag to use when displaying **upcoming/future events** (or past events, or events within a specific timeframe) is the goal.

**`{exp:calendar:cal}`** is the only tag that creates a truly chronological list of events and respects the time/date window set in `date_range_start=""` and `date_range_end=""` (i.e. it looks for events/occurrences within the set timeframe).

(**Note**: add `pad_short_weeks="n"` as well to `{exp:calendar:cal}` to avoid it from adding extra days in your timeframe to complete a calendar "week row")

The following documentation page, which explains in more details why/when each of the main Calendar tags are used, is a strongly recommended read: http://www.solspace.com/docs/calendar/getting\_started/

# Answer
> 0 votes
If you look at the events documentation. Notice how the date range end parameter. Defaults to today. You just need to specify a date range end for the events tag to be used this way.

---
Tags: solspace-calendar
---


# Question
Title: Connecting Freeform Form with a specific page (so the client can do this)
Here is the scenario ... I have freeform pro installed and working perfectly on a client's site. The site uses the Structure module for creating pages, etc. Currently I simply add the freeform form to a structure page by use of a conditional that checks the URL and if there is a match the form is rendered.

Client is asking for a way to select which page the form will go on so we can cut out the manual conditional check. It seems to me there could be a way to do this but I'm coming up empty here. Looking for some best practice type of advice here.

# Answer
> 2 votes
I might be misunderstanding what you need, but whenever I've set this up I use Pixel & Tonic Switch in the channel entry to turn the form on or off. (That seems a bit simple so I'm guessing you are looking for something else!)

# Answer
> 1 votes
This functionality exists in the FreeForm Pro version. Complete details here:

http://www.solspace.com/docs/freeform/channel\_entry\_fieldtype/

> Freeform allows you to call your forms directly into a channel entry. Simply create a custom channel field (of the Freeform fieldtype), and it will allow your admins to select Composer-based forms to be linked directly to a the channel field. You can then have the form(s) display on the front end alongside your channel entry using the Channel:Entries tag.

The resulting field looks like this on the edit form:

# Answer
> 0 votes
You could potentially use a custom field also.

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


# Question
Title: Best practices: Location-aware Navigation in EE2?
Recently upgraded an older Expression Engine site from 1.x.x to 2.7.3, and looking to upgrade to 2.9.0 and optimize some of the slower code. One of the issues I'm working on is getting rid of a lot of embed tags, which were used in the old site to embed navigation, using embed variables to set classes to display active links in the embedded navigation template.

I'm looking for some general guidance on Expression Engine best practices to do something like that - with the goal of finding a solution that can do it with the least queries and load the fastest, even when dealing with a lot of conditionals in the navigation.

This is what I want to happen: when on site/about, the navigation menu will be rendered like this:

```
<ul>
<li><a class="selected" href="{site_url}about">About Us</a></li>
<li><a href="{site_url}about/community">Community</a></li>
<li><a href="{site_url}about/people">Directory</a>
</ul>

```

The idea is that the "selected" class changes depending on the template that's being loaded to let users know where they are in the site..

So far, I've considered the following possibilities:

1. Use preparse in Low Variables:

**Template: site/about**

```
{exp:low_variables:single var="lv_subnav_about" preparse:selected="about"}

```

**Low Variable: lv\_subnav\_about**

```
<ul>
<li><a {if selected == 'about'} class="selected"{/if}  href="{site_url}about">About Us</a></li>
<li><a {if selected == 'community'} class="selected"{/if}  href="{site_url}about/community">Community</a></li>
<li><a {if selected == 'people'} class="selected"{/if}  href="{site_url}about/people">People: Directory</a>
</ul>

```
2. Revising the scheme to use segments instead of passing variables to accomplish the same goal. This would still probably require the same number of conditional statements in the embed/low variable, but would using segments help at all, performance-wise?
3. Using the new (in EE 2.8.x) layout variables to do the same thing, i.e. {layout="site/normal" selected="about"}. This would have another advantage in that I could create layouts that take care of other embeds I'm trying to get rid of - header/footer/sidebar/etc.

Please let me know if you have any ideas on what the best way to accomplish this goal might be, even when dealing with much more complex navigation (passing multiple variables to indicate category and page, etc) - thanks!

# Answer
> 1 votes
I personally always take the route of using segment conditionals to set my active state CSS class. It's easy to code and manage since it's handled in one template.

```
<li><a {if segment_1 == 'about'}class="selected"{/if}  href="">About Us</a></li>

```

# Answer
> 1 votes
Using segments as Anna described in her answer definitely works well for some sites. But it can get tedious on large or deep navigation trees and is not practical when the client needs to manage the navigation.

In those cases, or if you just want to cut out all the conditionals, take a look at **NavEE**. It's very flexible and easy to use. Well worth the price. Just build out a navigation tree by linking to Pages entries, regular entries, templates, or custom URL and then NavEE does the rest.

As an example of the tag use, here is a main nav tag from a current project of mine. It generates a dropdown navigation with the CSS classes I want to use for the active parent and active page styles. It does a great job of applying the active classes dynamically based on the requested page.

```
{exp:navee:custom
    nav_title="main"
    wrap_type="ul"
    class="sf-menu"
    selected_class="active"
    selected_class_on_parents="true"
    parent_selected_class="active-parent"
    max_depth="2"
}
    <li><a href="{link}" class="{class}">{text}</a>{kids}</li>
{/exp:navee:custom}

```

And even if you run into a more unusual navigation scenario should be able to adapt NavEE to your situation by using one of the many parameters or additional options.

---
Tags: ee2, low-variables, parse-order, segments, navigation
---


# Question
Title: Moblog parameter to pull sender from email?
I have Moblog running as I'd hoped except how to pull the sender's name from the email. Since the subject line automagically becomes {title}, it seems it should be as simple, but I can't find documentation anywhere, and am drawing a blank.

Any suggestions?

Thanks, Jo

# Answer
You don't detail where you are trying to "push" the sender's name after you've pulled it.

If you want to use it to set the entry Author, you can do that with the "User Authorization" override: http://ellislab.com/expressionengine/user-guide/add-ons/moblog/index.html#user-authorization

Or you can push data into fields like this:
http://ellislab.com/expressionengine/user-guide/add-ons/moblog/index.html#field
> 1 votes

---
Tags: fields
---


title: tags not rendering the right url

text:
# Question
Title: tags not rendering the right url
i can't seem to find out why a tag would be rendering the wrong url.

the problem is that `{webm}` should be rendering to `http://www.hallmarklighting.com/video/hallmarkYT.webm` with the `/video/` not as `http://www.hallmarklighting.com/hallmarkYT.webm` which it's currently doing.

the channel field is set to *file* and the directory is set to grab the video from the folder *video*

let me know if there is anymore relevant info needed.

**EE markup:**

```
                <div class="lb-content"><!-- main content of lightbox -->
                    <video width="640" height="480" poster="{poster}" preload="metadata" controls>
                            <source src="{mov}" type="video/mov" />
                            <source src="{mp4}" type="video/mp4" />
                            <source src="{webm}" type="video/webm" />
                            You're browser seems to be out of date as it doesn't support Video, visit <a href="{alternative_link}" target="_blank">youtube.com/{title}</a> to watch this video.
                    </video>
                </div><!-- end content -->

```

**what's being rendered:**

```
<div class="lb-content"><!-- main content of lightbox -->
    <video width="640" height="480" poster="http://www.hallmarkcollective.com/images/uploads/hallmarkIntro.jpg" preload="metadata" controls>
        <source src="http://www.hallmarklighting.com/hallmarkYT.mov" type="video/mov" />
        <source src="http://www.hallmarklighting.com/hallmarkYT.mp4" type="video/mp4" />
        <source src="http://www.hallmarklighting.com/hallmarkYT.webm" type="video/webm" />
        You're browser seems to be out of date as it doesn't support Video, visit <a href="http://youtu.be/E6S9vadARk0" target="_blank">youtube.com/Introducing Hallmark Lighting</a> to watch this video.
    </video>
</div><!-- end content -->

```

thank you.

# Answer
It looks like the URL of the upload directory is set wrong.
> 1 votes

---
Tags: channel-entries, tags
---


# Question
Title: Using Stash variable as Member Categories parameter
I'm trying to retrieve a category ID to be used in the Member Categories tag pair that is used later on in my template. I know for sure that the variables is being set (I tested it outside the Member Categories tag), but for some reason it refuses to work as a parameter. I've tried adding process="end" but that didn't seem to do anything. Any help would be appreciated!

```
    {exp:channel:entries channel="my_channel" limit="1" dynamic="yes" disable="pagination"}
        ...
        {exp:stash:set name="my_id"}
            {categories limit="1"}
                {category_id}
            {/categories}
        {/exp:stash:set}
    {/exp:channel:entries}

```

...

```
    {exp:member_categories:members category_id="{exp:stash:get name='my_id' process='end'}" limit="4" backspace="1"}
        {screen_name},
    {/exp:member_categories:members}

```

# Answer
> 1 votes
I think there's a few different ways to get around the parse order issue. One would be instead of adding process=end you could wrap the member\_categories tag pair with stash parse:

```
{exp:stash:parse process="end"}
    {exp:member_categories:members category_id="{exp:stash:get name='my_id'}" limit="4" backspace="1" parse="inward"}
        {screen_name},
    {/exp:member_categories:members}
{/exp:stash:parse}

```

(also added parse=inward to the members tag parameter, but not sure if you'll need it)

---
Tags: stash, member-categories
---


# Question
Title: Non-Paginated, Dynamic Adding Search Results
I have been asked to set up a "show more" search results expansion instead of "next page" style. An example would be, when you are reading comments on LinkedIn, instead of a list of pages of comments you can review, you simply click "show more" and it dynamically loads additional comments.

I purchased Solspace Super Search this morning, as the built in search was too limited for our needs. I'm curious if anyone has created something like this already, and would have suggestions. Alternately, if no one has done this, any suggestions on where I might start? (*long* time programmer, PHP and many more, don't hold back if you think i might not understand)

# Answer
> 0 votes
The 2 ways to approach this I know of are:

1 - grab all the results with super search and hide the extra, using js to reveal the extras as needed

2 - grab only a portion of the results with super search, then as needed use ajax to get additional results from a second template (maybe a template formatting the results as json).

Whether I would use 1 or 2 would depend on how many entries you expect to show, seo concerns, and how much time you want to spend(!).

---
Tags: solspace, supersearch, dynamic
---


# Question
Title: Template is rendering Grid field output incorrectly within an <a href""> tag
I have a Homepage channel setup with a `homepage` field group.

Within the field group, there is a `homepage_slider` Grid field and within that Grid there is an `image` and `page_link` field.

When called in via the following `{homepage_slider:image}` renders correctly (the image shows without issue.

However, using the following:

```
<a href="{homepage_slider:page_link}{homepage_slider:page_link:pager}{/homepage_slider:page_link}">

```

Renders only as:

```
<a href="{/">

```

Outside of the it appears to work and display the correct `page_uri`.

Looking at the syntax, it looks like it should be OK and I've trawled through the other settings inside the CMS without much luck in terms of debugging. I've also incrementally removing elements of the template and the problem occurs as soon as the element goes inside of the `<a href="">` tag.

EDIT: Here is the full code block:

```
{homepage_slider}
<div class="slide">
    <a href="{homepage_slider:page_link}{homepage_slider:page_link:page_uri}{/homepage_slider:page_link}">{exp:ce_img:single src="{homepage_slider:image}" width="960" height="450" crop="yes"}</a>
</div>
{/homepage_slider}

```

(Note: Running EE 2.8.1)

# Answer
I'm not sure why the page\_link is a tag pair or what page\_link:pager is. Could you elaborate on that?

It looks to me like the correct code should be:

```
{homepage_slider}
<div class="slide">
    <a href="{homepage_slider:page_link}">{exp:ce_img:single src="{homepage_slider:image}" width="960" height="450" crop="yes"}</a>
</div>
{/homepage_slider}

```
> 0 votes

---
Tags: relationships, grid, links, page-uri
---


# Question
Title: ExpressionEngine: How do I block direct access to templates that I am using for embeds only
I have a template group that I am using to store embeds like header and footer. I do not want people to be able to directly access those templates by going to www.domain.com/embeds/header. I want that to redirect to the 404 page. How do I go about this? Is there a way to block template groups from direct access? Would this be better done in .htaccess? Thanks for any help.

# Answer
In versions of EE2 *prior to 2.9* if you start the template name with a dot it will not be directly accessible.

In the just-released EE 2.9 you can specify a different character instead of dot and the default has been changed to underscore.

Documentation on this feature (currently describes 2.9 handling):

http://ellislab.com/expressionengine/user-guide/templates/hidden\_templates.html

I don't believe EE has a mechanism for blocking direct access on the template-group level. If you needed that then you would probably want to do on the server level (.htaccess rewrites).
> 2 votes

---
Tags: templates, embeds
---


# Question
Title: How to add custom field in ExpressionEngine publish entry
I need to add a custom field in the publish entry area (specifically in the date tab). Should I use the Control Panel class or is there a preferred method?

# Answer
> > If I understood correctly, you need to add an extra field to an already existing channel and you can easily do that from the CP by going to Admin \> **Channel** **Administration \> Channel Fields**.
>
> Browse and click on the channel that you want to add your custom field to and create a new channel field.
>
> To put your field under the Date tab:
>
> Refer to this http://ellislab.com/expressionengine/user-guide/cp/content/publish\_page\_layouts.html
> 1 votes

---
Tags: custom-fields
---


# Question
Title: How to dynamically fill out a form value field based on a link clicked on another page?
So I am brand new to ExpressionEngine....

I am on an expression engine entry page with a few hyperlinks...Based on which hyperlink I click, I want to navigate to another expression engine page with a contact form and dynamically set the value of the subject field based on which hyperlink was clicked on the previous page......How do I go about doing this? FYI - I'm not new to web programming - other frameworks I've worked in let you set a parameter in the hyperlink so it becomes part of the web request to the next page where you can then grab the parameterized value for setting the subject.

If you could even point me in the right direction, that would be helpful.

# Answer
It's going to be a little more manual with expressionengine. You might have to set the parameters in the link yourself and use php (or a plugin)

Build the link similar to this:

```
<a href="/form?name={name}">{name}</a>

```

and fill out your form using php (php must be enabled on the form template):

```
<input type="text" name="name" value="<?php echo $_GET['name']; ?>">

```

Or that plugin:

```
<input type="text" name="name" value="{exp:parameters get="first"}">

```
> 3 votes

# Answer
Just use url segments. In the hyperlink href (www.domain.com/form) add whatever parameter you like to it (www.domain.com/form/subject) and then on the form page put value="{segment\_2}" in your input tag. Read more in the EE docs about segments. You might have to encode/decode the uri if you use spaces etc.
> 0 votes

---
Tags: dynamic, email-contact-form
---


# Question
Title: split dynamic number of entries dynamically between 2 columns
I have a list of dynamic entries I want to split evenly between two columns. Is there a way to do this?

# Answer
> 1 votes
Use jQuery. Something like this maybe: http://johndoesdesign.com/blog/2012/jquery/how-to-split-a-dynamic-list-into-two-equal-columns-using-jquery/

# Answer
> 2 votes
You could try using Splitter, I've used it before for tis purpose.

# Answer
> 1 votes
If they have to be in absolutely two columns, you can make two channel entries calls and use the expressionengine modulus (%) operator

```
<section class="column1">
{exp:channel:entries channel="foo"}
    {if count % 2 == 0}
        {title}
    {/if}
{/exp:channel:entries}
</section>
<section class="column2">
{exp:channel:entries channel="foo"}
    {if count % 2 == 1}
        {title}
    {/if}
{/exp:channel:entries}
</section>

```

But that means that you are doubling your queries. I would suggest trying an alternate html/css layout that allows you to make a single channel entries call.

---
Tags: dynamic
---


# Question
Title: Expresso Store - upload multiple discount codes to be used once
I want to generate a list of discount codes (any advice appreciated for doing this) which I can then use to offer free shipping across the site, valid up until a specific date.

What's the best way to go about creating these discounts? I'd prefer not to have to manually create hundreds of discounts all the same except for the discount code.

# Answer
Probably the most basic way to do it yourself is probably using Navicat and Excel. Create one discount that matches how you want it work. Export the SQL table to your desktop as a CSV or XLS file. Open that in Excel and duplicate the rows adjusting the code column as you want to show differences. Then import those rows back into the database. You could do it other ways, but this would be the novice ways for those with little MySQL/Php experience.
> 3 votes

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


# Question
Title: Expresso: international orders not able to complete
A client, whose website I did not develop, is having intermittent problems with international orders. Customers are not able to progress from the initial cart/address screen to any other page.
I think a fix for this client shouldn't be too hard, but since I'm not an EE developer, I don't know how to do it. The client wants shipping charges to be automatically generated for U.S. orders only. All international orders will require direct follow-up. So, how do I set it up so that shipping cost information is suppressed for all international orders and visible only for U.S. orders?

Thank you!

# Answer
> 1 votes
I believe if you just use the built in shipping option and set a price only for United States and set all other countries to 0 it should work pretty automatic. Then detect if the price is 0 with an if statement in the cart/checkout and show the message you want. Then if someone chooses US you will get the price added.

This could vary depending on your shipping setup though.

---
Tags: expresso-store
---


# Question
Title: Low Search - Search in Title and/or Grid Field
New to the lovely Low Search, so apologies for likely dumb question.

I've a single Input search form, that I'd like to use to search both entry titles (in one channel/collection) as well as one specific Grid field.

So far I seem to be able to get Entry Title results with:

```
{exp:low_search:form result_page="root/search_results" }
  <fieldset>
    <label for="keywords">Keywords</label>
    <input type="search" name="keywords" id="keywords" />
    <button type="submit">Search</button>
  </fieldset>
{/exp:low_search:form}

```

Or, results from the custom Grid field with:

```
{exp:low_search:form result_page="root/search_results" }
  <fieldset>
    <label for="keywords">Keywords</label>
    <input type="search" name="search:downloads:reference" id="reference" />
    <button type="submit">Search</button>
  </fieldset>
{/exp:low_search:form}

```

I don't seem to be able to get an either/or type result going on. On a basic level, I'd only really want the entry\_title / url\_title. I'm likely missing a key fundamental of the setup somewhere along the line so all help hugely appreciated even if it involves calling me dense ;)

Ta!

*EE 2.8.1 / Low-Search 3.1.6*

# Answer
> 2 votes
I'd recommend creating a Collection where you only add weight to the Title and the Grid field. Make sure the `reference` column in the Grid field's settings is marked as searchable. If it wasn't searchable before, you might need to re-save the entries so it populates the `exp_channel_data` table, which in turn Low Search uses to build its index.

Then you could use this:

```
{exp:low_search:form result_page="root/search_results" }
  <fieldset>
    <label for="keywords">Keywords</label>
    <input type="search" name="keywords" id="keywords" />
    <input type="hidden" name="collection" value="my_new_collection" />
    <button type="submit">Search</button>
  </fieldset>
{/exp:low_search:form}

```

...where `my_new_collection` is the collection described above.

# Answer
> 1 votes
Try using the 'search:title' parameter instead of keywords, and use that with your grid search:

```
{exp:low_search:form result_page="root/search_results" }

    Title: <input type="search" name="search:title">
    Grid: <input type="search" name="search:downloads:reference">

    <button type="submit">Search</button>
{/exp:low_search:form}

```

Update: Or alternatively, using a keyword search field and adding the field searches to the results tag:

```
{exp:low_search:results
    query="{segment_3}"
    search:title="{low_search_keywords}"
    search:downloads:reference="{low_search_keywords}"
    limit="10"
}
  ...

```

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


# Question
Title: Multisite - channel fields do not work in child template pages
Using expression engine multi-site.

we have a master site "master-site" & a slave/child site "slave-site".

I am creating a new channel "blogs" & it's channel fields.

1) Create "blogs" channel & channel fields from "slave-site" admin panel.

Issue: Only default channel tags "{title}", "{entry\_id}" etc are working in templates. If we create a new channel fields then tags for these channel fields do not work in template and shows tags as it is in browser.

Eg: If we create a channel field "blog\_description" and using "{blog\_description}" tag in template but in browser tag not fetching it's value and showing tag "{blog\_description}".

2) Create "blogs" channel & channel fields from "master-site" admin panel.

Issue: "blogs" channel & channel fields are not appearing at "slave-site" admin panel.

# Answer
> 1 votes
Add channels so all from the original site are present, then in `exp_channels` table in the DB manually set the field group for each to be the same as the corresponding channel in the original site.

---
Tags: ee2, multi-site-manager, channel
---


# Question
Title: Return only entries which have the same custom field as the current displayed entry?
I'm trying to display a list of links dynamically based on the current entry that is being displayed. with code along the lines of this:

```
{exp:channel:entries channel='tour' disable="category_fields|member_data|pagination" dynamic="no" show_expired="no"}
    {if tour_name=="tour_name"}
        <h4 class="sub"><a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} – {tour_date_end format="%j %F %Y"}</a></h4>
    {/if}
{/exp:channel:entries}

```

I know that the code above won't work, but thought it illustrated what I was trying to achieve. Basically I have a series of tours and some of them have the same name. I want to display links to these ones with the same name, when viewing one of those tours. I know this would be best to use either categories or a playa field, but aren't able to go this route because some of the data is pulled in from an external database. I tried to use stash to set the current tour\_name and then get it within the if conditional, but this wouldn't work either.

I wonder if it would be possible using the query module? Or another plugin? Maybe it's not possible at all?

If anyone can offer any help, I'd appreciate it. Thanks.

# Answer
You can always pass the data to an embed and search for entries again:

```
{exp:channel:entries channel='tour' [...] }
    [...]
    {if tour_name}
        {embed="pages/.related_tours" name="{tour_name}" current_entry="{entry_id}"}
    {/if}
{/exp:channel:entries}

```

On you embed, you can look for entries using the query module, sure, but the channel module is easier:

```
{exp:channel:entries channel='tour' search:tour_name="{embed:name}" entry_id="not {embed:current_entry}" [...]}
    [...]
{/exp:channel:entries}

```
> 0 votes

---
Tags: channel-entries, custom-fields, query
---