String in URL

Developer

Laisvunas

3rd Party (Commercial)


EE Version Support

  • ExpressionEngine 1.x
  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

This plugin enables searching for certain strings in URL segments.

PARAMETERS

1) segment - required. Allows to specify URL segment in which certain string should be looked for.
Possible values: 1, 2, 3, ... 9. You can use pipe operator to stack several URL segments, e.g. segment=“3|4”

2) string - optional. Allows to specify the string which should be looked for in URL. You can use
pipe operator to stack several strings, e.g. string=“article|news”.

3) exact_string - optional. Allows to specify string which should exactly match URL segment. You can use
pipe operator to stack several strings, e.g. exact_string=“technical|projects”.

NOTICE: at least one of the parameters “string” and “exact_string” must be defined!

4) string_pos - optional. Allows to specify position in URL segment at which string should be present.
Possible values - any positive integer starting from zero or “any”. Default value is “any”.

5) exact_match - optional. Allows to specify if string and URL segment should match exactly.
Possible values - “yes” and “no”. Default value is “no”.

Using parameters ‘string’, ‘exact_match=“no”’,
and “exact_string” you can search both for exact match and for match at some position.

6) on_true - optional. Allows to specify what the variable {string_in_url} should output in case string
was found in specified URL segment(s). Possible values - “segment”, “string” or any custom string. If
the value of this parameter is “segment”, then URL segment in which string was found will be outputted;
if the value of this parameter is “string”, then the value of “string” parameter will be outputted; if
the value of this parameter is some custom string, then that string will be outputted. In case you need to output
empty string the leave this parameter undefined.

7) on_false - optional. Allows to specify what the variable {string_in_url} should output in case string
was not found in specified URL segment(s). Possible values - “segment”, “string” or any custom string. If
the value of this parameter is “segment”, then URL segment in which string was looked for will be outputted;
if the value of this parameter is “string”, then the value of “string” parameter will be outputted; if
the value of this parameter is some custom string, then that string will be outputted. In case you need to output
empty string the leave this parameter undefined.

VARIABLES

1) string_in_url - outputs the value of “on_true” parameter if the string was found in specified URL segment(s) or
the value of “on_false” parameter if the string was not found.

USAGE

The code

{exp:string_in_url  segment="4" string="comment_" string_pos="0" on_true="string_found"  on_false="string_not_found"}

{string_in_url}

{/exp:string_in_url}

will output the string “string_found” in case string “comment_” is present at the start of the segment_4, and will
output the string “string_not_found” in case string “comment_” is not present at the start of the segment_4.

This entry was created May 13, 2010, 11:45 am.
This entry was last updated September 7, 2011, 3:00 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

There are no reviews for this add-on yet.

What are you waiting for? Rate it and review it!