Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 2.28 KB

File metadata and controls

82 lines (61 loc) · 2.28 KB

Views

Views represent the type of interface the node appears as to the client and is declared using the np-view and np:view when defined as a fallback.

📚 Types

The examples shown define attributes using explicite declarations.

1️⃣ Base

Is the most basic view type that only requires a title, and a description. All other view types inharet from this view.

<article 
np-node="primary" np-view="base" np-title="..." np-desc="...">
    ...
</article>

📇 Article

The article view is ment to add additional, longer content to the a node and requires the np-article attribute.

<article 
np-node="primary" np-view="article" np-title="..." np-desc="..." np-article="...">
    ...
</article>

🌆 Gallery

The gallery view allows you to display up to 4 images in a 2 by 2 grid. The images can be declared using the np-img attribute.

<article 
np-node="primary" np-view="gallery" np-title="..." np-desc="..." np-img="...">
    ...
</article>

📇 Form

The form view allows you to add a simple form with inputs to the node.

<article 
np-node="primary" np-view="form" np-title="..." np-desc="..." np-input="...">
    ...
</article>

🟢 Explicit Definitions

Explicit view types allow you to better control the type of view the node should display.

When defining a node explicitly as base, even if a node defined the field property np-img it will be ignored.

<article 
    np-node="primary"
    np-view="base"
    np-title="John Mayer: Grammy-Winning Music Icon"
    np-description="John Mayer, a Grammy-winning guitarist and singer, is known for soulful hits like “Gravity” and “Slow Dancing in a Burning Room.">

    ...

</article>

🟠 Implicit Definitions

NextPage has the ability to detect the view type by the Field Properties defined in the node.

By defining at least one np-image field attribute within the node, NextPage will know to define the node view as gallery.

<article 
    np-node="primary"
    np-title="John Mayer: Grammy-Winning Music Icon"
    np-description="John Mayer, a Grammy-winning guitarist and singer, is known for soulful hits like “Gravity” and “Slow Dancing in a Burning Room."
    np-img="...">

    ...

</article>