GithubHelp home page GithubHelp logo

loren138 / entry_type Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rsanchez/entry_type

0.0 2.0 0.0 243 KB

A dropdown fieldtype that shows/hides other fields on the publish page.

Home Page: http://devot-ee.com/add-ons/entry-type/

entry_type's Introduction

Entry Type

An ExpressionEngine add-on for hiding publish fields on a conditional basis. The Entry Type fieldtype creates a dropdown field which can hide other publish fields depending on the value chosen. The Entry Type extension allows you to hide specific publish fields depending on the entry's status, Pages/Structure template, or Structure page depth.

Entry Type

Installation

  • Requires PHP 5.2
  • Download the addon and rename the folder to entry_type
  • Copy to system/expressionengine/third_party
  • Install the extension and fieldtype

Fieldtype Tags

{your_field_name}

The short name for the entry type selected.

{your_field_name:label}

The label for the entry type selected.

{if {your_field_name:selected option="link"}}

Check whether the specified option is selected. (Use the short name).

{your_field_name all_options="yes"}
	{option} {option_name} {label} {selected}
{/your_field_name}

List all your options.

Fieldtype Settings

  • Short Name - the value of the field, for use in templates and conditionals
  • Label - the label for the value
  • Hide Fields - choose the fields to hide when the specified value is chosen

Extension Settings

  • Channel - choose one of your channels
  • Field - choose either Status or Template
  • Settings: Value - choose the status or template value that will trigger this "type"
  • Settings: Hide Fields - choose the fields to hide when the specified value is chosen

Examples

Displaying different content based on entry type.

{exp:channel:entries}
{title}<br />
{your_entry_type_field:label}<br />
{if your_entry_type_field == 'link'}
	{link_url}
{if:else your_entry_type_field == 'video'}
	{video}
{if:elseif your_entry_type_field == 'image'}
	{image}
{/if}
{/exp:channel:entries}

Use with Switchee:

{exp:channel:entries}
{title}<br />
{exp:switchee variable = "{your_entry_type_field}" parse="inward"}

	{case value="link"}
	{link_url}
	{/case}

	{case value="video"}
	{video}
	{/case}

	{case value="image"}
	{image}
	{/case}

{/exp:switchee}
{/exp:channel:entries}

entry_type's People

Contributors

allmarkedup avatar leevigraham avatar rsanchez avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.