Download the PHP package yawik/landingpages without Composer
On this page you can find all versions of the php package yawik/landingpages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yawik/landingpages
More information about yawik/landingpages
Files in yawik/landingpages
Package landingpages
Short Description Create Landingpages for job searches to optimize SEO
License MIT
Informations about the package landingpages
YAWIK Landingpages
Create landingpages for job searches
- Overview
- Installation
- Usage
- Configuration
- Example configuration
- Rendering
- Landingpages helper
- Landingpage helper
- License
Overview
- Configurable landing page url
- Group landing pages in categories at any depth
- Combine categories or landing pages dynamically; Either via configuration or the view helpers
- Convenient view helper to display links to landing pages
Installation
To use as yawik module, you need to require it in your YAWIK project:
To contribute, you need to clone the repository:
Start a local webserver with:
or
you should be able to access your yawik at http://localhost:8000
Usage
Configuration
Copy config/landingpages.config.local.php.dist
to your autoload directory and
rename to landingpages.config.local.php
.
In this file you can configure the route and the landing pages and categories
- This route is a child route of the "lang" route
(prefixed always with "
/ ", e.g.: "/en/") - The string "%slug%" must be in the definition - this will be replaced by the landing page slug (see below)
- The route must not contain "--" (two dashes) - this is used to indicate combined categories
Here you configure the categories, landing pages and combined items as nested arrays. The array keys are the slugs of the items - they must be unique, even in nested arrays.
There are three "types" of items
- categories:
- have the array key 'items', which value is an array of slug => item
- may have the array key 'text', which value is used as the display name
- landing pages:
- have the array key 'query', which is an array where you specify the values of the search form fields:
- 'q' : Search text
- 'l' : Location
- 'd' : Distance
- may have the array key 'params', which is an array of additional route parameters injected to the RouteMatch object.
- may have the array key 'text', which value is used as the display name
- combined items:
- have the array key 'combine', which value is an array of slugs. These slugs need to be defined in the configuration array.
- may have the array key 'glue', which value is used as concatenation string between the display names of the combined items.
- may have the array key 'text', which value us used as the display name.
Example configuration
Rendering
This module provides two view helpers, one to easily render links to landingpages or categories and the second one for access to the landing page entity when on a landing page.
Landingpages helper
-
$slug
is either a string corresponding to a slug defined in the configuration or an array of slugs. In the latter case the resulting category entity which is passed to the$partial
is the combination of all slugs. You may specify the glue to use with an array entry with the key 'glue'. -
$partial
is the name of the view partial used to render the links. At the moment, only one partial is provided by this module, which is used as the default:
landingpages/button $values
is an array of variable name => value pairs to be injected in the view partial.
The category entity is passed as the key 'category'.
Landingpage helper
- returns
null
if currently no landingpage route is invoked. - Acts as proxy to the landing page entity
- Provides the method
isCombined()
to quickly check, if the current landingpage is a combination of multiple slugs.
Examples
License
MIT