Download the PHP package thepixelage/craft-markasnew without Composer

On this page you can find all versions of the php package thepixelage/craft-markasnew. 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 craft-markasnew

Mark As New Plugin for Craft CMS

Mark As New is a Craft CMS/Craft Commerce plugin for marking native elements as new. It provides a date/time field in the edit pages of entries and products that can be used to specify a date/time until when the entry or product is to be considered as new.

Currently, only these native elements are supported:

Features

New Date/Time Field Edit Page in Control Panel

A "Mark New Until" date/time field is added to the right sidebar of entry editing and product editing pages in the control panel. If set, it specifies that the element is considered as new until the selected date/time.

For entries, the field is displayed after the Expiry Date field. For products, the field is displayed only after the product is saved, and is displayed after the Date Updated meta field.

Exclude/Include Entry Types or Product types

By default, the field is added to all entry types and product types. If you wish to exclude certain types from displaying the field, add a markasnew.php file to the config folder, and specify the following:

The types are specified in the format of <namespace>.<typeHandle>. The namespaces entries and products indicate the type handle is an entry type handle and a product type handle respectively.

If you have a particularly long list of entry types and product types to exclude, you can instead use the includeTypes key:

The above will hide the field from all types, except those specified under includeTypes.

Element Attributes

Entries and products get two new attributes that can be accessed to find out if they are marked as new or to retrieve the date when it is no longer marked as new.

Attribute Data type
markedAsNew bool
markNewUntilDate DateTime

There are also two element index table attributes corresponding to these two element attributes that can be used to display their columns in the entry listing or product listing in the control panel.

Element Query

For example, to query a list of entries in the blog section that are marked as new:

And to query a list of products that are marked as new:

GraphQL

For example, to query a list of entries that are marked as new:

And to query a list of products that are marked as new:

Condition Rule Type

A custom condition rule type "Marked As New" is added to the ElementCondition so it can be used to filter the entry listing and product listing in control panel.


Created by ThePixelAge


All versions of craft-markasnew with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
craftcms/cms Version ^4.0.0
ext-json Version *
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 thepixelage/craft-markasnew contains the following files

Loading the files please wait ....