Download the PHP package derhaeuptling/contao-mobilecontent without Composer

On this page you can find all versions of the php package derhaeuptling/contao-mobilecontent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contao-mobilecontent

Mobile Content (mobilecontent)

This extension lets you show or hide specific articles, content elements and frontend modules on mobile or desktop devices. Image fields are extended – you can now add an different image for the mobile devices.

It works out of the box by recognizing the visitor user agent and displaying the appropriate content.
For use with CDN that caches the pages you may want to enable a separate mobile domain though (see explanation below).

The extension is compatible with Contao 3 and 4.

Toggle the content

To toggle the content you can either edit the element settings or simply use the icons available in the list view:

Different mobile image

To use a different image for mobile devices check Different mobile image on any elment with an image.

Mobile domain

In the website root settings you can enable the special domain for the mobile devices.
If mobile domain is enabled mobile and desktop layout will be distinguished by domain only.

Front end module

To allow easy switch between the desktop and mobile domains you can add the mobile/desktop switch front end module that displays a short information about the parallel domain and allows the visitors to switch to the correct version of the website for their device.

Auto-redirect

When the auto-redirect is enabled, right before the visitor is redirected to the correct version of the page the script adds the mobile-content-redirecting CSS class to the <body> element.

Note: when this feature is enabled, the toggle links get the extra hash parameter to the URL. When the user visits a page with that parameter (e.g. by clicking the link) the cookie will be set that prevents from yet another redirect back. This allows e.g. the mobile visitors to be redirected to the mobile version of the website on first page view but they can still view the desktop version by explicitly clicking the link.

mobile/desktop detection by Viewport

If the Contao default mobile/desktop detection by User Agent does not fit your needs, you can alternatively activate detection by viewport width.
As this detection is done by JavaScript, the mobile/desktop switch front end module needs to be added to the layout.

Insert tags

mobile::toggle

Adds a link to toggle between desktop and mobile view. This link carries the classes mobile_toggle and desktop or 'mobile' corresponding to the destination of the link (not the type of page it is on!).

mobile::toggle_url

Is replaced by the URL to the currently inactive view mode.

mobile::toggle_text

Is replaced by the content of the language variable $GLOBALS['TL_LANG']['MSC']['toggleDesktop'][0] or $GLOBALS['TL_LANG']['MSC']['toggleMobile'][0]. This is normally the text of the standard toggle link created by mobile::toggle.

mobile::toggle_title

Is replaced by the content of the language variable $GLOBALS['TL_LANG']['MSC']['toggleDesktop'][1] or $GLOBALS['TL_LANG']['MSC']['toggleMobile'][1]. This is normally the title of the standard toggle link created by mobile::toggle.

mobile::alternatives::alternative_desktop:alternative_mobile

This insert tags shows only one of the two alternatives alternative_desktop or alternative_mobile depending on which type of view is currently active. Note: there is a single semicolon between the two last chunks in the insert tag.

ifmobile […] endifmobile, ifndesktop […] endifndesktop

The content between the start and and tag is skipped if it appears on a desktop page.

ifdesktop […] endifdesktop, ifnmobile […] endifnmobile

The content between the start and and tag is skipped if it appears on a mobile page.

Developers

To check if the current page is mobile:

Example for the templates:


All versions of contao-mobilecontent with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
contao/core-bundle Version ~3.5 || ~4.1
contao-community-alliance/composer-plugin Version ~2.4 || ~3.0
codefog/contao-haste Version ^4.17
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package derhaeuptling/contao-mobilecontent contains the following files

Loading the files please wait ....