• Resolved grigorax

    (@grigorax)


    In the PODs shortcode, there is no parameter for number of columns, as there is for PORTFOLIO. Somebody says it can be done with CSS. I tried that but it didn’t work. Any ideas?

    In general, is there documentation for accessing PODs elements via CSS?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @grigorax

    CSS is markup language and not related to Pods. Pods only provides a method to create the structure of your content. The UI part can then be adjusted to suit your needs manually.

    Every theme works very differently so what CSS is required will depend on your theme. A lot of themes still use Bootstrap for example which uses a grid system (v4: https://getbootstrap.com/docs/4.0/layout/grid/ or v5: https://getbootstrap.com/docs/5.3/layout/grid/#example)

    You can also use generic CSS to create grids by following these guides: https://www.w3schools.com/css/css_grid.asp

    W3C is a great resource to learn CSS.

    Cheers, Jory

    Thread Starter grigorax

    (@grigorax)

    Hey thanks Jory. The Bootstrap thing is overkill for me, as I am focussing on content creation rather than web development.

    The W3C CCS tutorial is terrific. I don’t mind learning a bit of CCS, as it is reasonably user-friendly for me. In HTML the /> stuff is total pain to type in, so I stay away from it as much as possible.

    Does than mean there is a way of feeding the PODs list output (that is, the output of the short-code statement) into a CSS module so it can be formatted properly? —I know about the PODs template, but that only operates on the formatting of the individual project-item.

    I am struggling with displaying in WordPress a gallery of my creative output . The blocks that are available to me are very limited. They tend to be limited to image display, but I need audio as well or an image-audio combination.

    Thanks again
    Greg

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @grigorax

    You can customize the output of a shortcode in any way you want.
    It’s even possible to define a custom template within that shortcode.

    More info here:
    Shortcode: https://docs.pods.io/displaying-pods/pods-shortcode/
    Template magic tags: https://docs.pods.io/displaying-pods/magic-tags/using-magic-tags/
    Creating a Pods template is recommended though it is possible to add a custom template through the shortcode or blocks. https://docs.pods.io/displaying-pods/pods-blocks/

    Through these options you can create your own templates and use the Pods fields any way you want. This will give you the flexibility to integrate the Pods output with the CSS and classes of your theme (or custom CSS).

    Cheers, Jory

    Plugin Support Paul Clark

    (@pdclark)

    • Create a new Pod of Content Type Custom Settings Page titled Design
    • Add fields named portfolio_columns of type Plain Text and some_color of type Color Picker

    Add this to a Code Snippet:

    <?php
    add_action(
    'wp_head',
    function() {
    ?>
    <style id="design-styles">
    :root {
    --portfolio-columns: <?php echo get_option( 'design_portfolio_columns' ); ?>;
    --some-color: <?php echo get_option( 'design_some_color' ); ?>;
    }
    .example-portfolio {
    display: grid;
    grid-template-columns: var( --portfolio-columns );
    background-color: var( --some-color );
    }
    </style>
    <?php
    },
    PHP_INT_MAX
    );

    Where:

    • design_portfolio_columns means the portfolio_columns field on the global design settings page.
    • design_some_color means the some_color field on the design settings page.
    • :root { ... } wraps declaration for CSS variables which can be used anywhere on the site.
    • --portfolio-columns and --some-color are newly defined CSS variables.
    • .example-portfolio { ... } is an example CSS class which would define HTML such as:
    <div class="example-portfolio">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    </div>

    …would display 1, 2, and 3 in three columns if the portfolio_columns field were set to 20% 30% 50% or similar according to grid-template-columns and the background color of the grid as whatever color is selected by some-color.

    Usage of CSS generally follows the syntax var( --some-color ). They cannot be used for some values, such as url( ... ), but can be used with calc( … ) to calculate values such as dimensions based on mixed values, such as percentage width or viewport width plus or minus pixels.

    Once a CSS variable is defined within :root, it can be used in any normal CSS or style="..." attribute.

    Thread Starter grigorax

    (@grigorax)

    Thanks Jory that’s pretty amazing ??. It’s nice to know that sort of thing is possible. However I have decided to go the route of plugins specializing in galleries.

    Thanks also Paul for your input.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.