Useful prompts for doing shit and notes

`# ๐Ÿ“„ How to Add a Widget to a Page (Code View)

<div class="full-width-bg">[widget=widgetname]</div>


๐Ÿ“‹ How to Select All the Fields in a Form

SELECT * FROM form_fields WHERE form_name = 'form_name' ORDER BY field_order ASC;


๐Ÿ”ฝ Prompt: Format List for Dropdown Values

Convert the following list of labels into a comma-separated string using this format:
slugified_key=>Label,
where:

  • slugified_key is all lowercase, spaces replaced with underscores, and special characters removed
  • Label is the original string with standard capitalization

Example Output:

buy_one_get_one=>Buy One Get One,free_shipping=>Free Shipping,...

Now Format This List:

item1, item2, etc


๐Ÿงฉ How to Display Custom Fields on Single Page View

<div class="well">
    <?php if (!empty($post['custom_business_name'])) { ?>
        <p><strong>Business Name:</strong> <?php echo $post['custom_business_name']; ?></p>
    <?php } ?>

    <?php if (!empty($post['custom_email'])) { ?>
        <p><strong>Contact Email:</strong> <?php echo $post['custom_email']; ?></p>
    <?php } ?>

    <?php if (!empty($post['custom_phone'])) { ?>
        <p><strong>Contact Phone:</strong> <?php echo $post['custom_phone']; ?></p>
    <?php } ?>

    <?php if (!empty($post['post_start_date'])) { ?>
        <p><strong>Start Date:</strong> <?php echo $post['post_start_date']; ?></p>
    <?php } ?>

    <?php if (!empty($post['post_expire_date'])) { ?>
        <p><strong>End Date:</strong> <?php echo $post['post_expire_date']; ?></p>
    <?php } ?>

    <?php if (!empty($post['post_promo'])) { ?>
        <p><strong>Promo Code:</strong> <?php echo $post['post_promo']; ?></p>
    <?php } ?>

    <?php if (!empty($post['post_url'])) { ?>
        <p><strong>Redemption Link:</strong> 
           <a href="<?php echo $post['post_url']; ?>" target="_blank"><?php echo $post['post_url']; ?></a>
        </p>
    <?php } ?>
</div>


โœ… Additional Notes

  • Step 1: Complete the form.
  • Step 2: Upload your photos.
    (The photo upload option unlocks after completing the form.)

๐Ÿ“Ž Variables

  • %%%form_external_link_tip%%%
  • %%%form_optional_placeholder%%%

๐Ÿงผ HTML Cleanup Guidelines

To maintain clean and maintainable code while preserving layout and visual appearance, apply the following rules:

  1. Remove empty background <div> blocks

    • Delete any <div class="absolute inset-0 ..."> that has no content or background image.
  2. Remove unnecessary <br> tags

    • If a <div> contains only <br>, delete the <br>.
    • If the entire <div> is just an empty overlay, remove it.
  3. Remove unused attributes

    • Delete data-original-content and contenteditable="false" attributes.
    • Remove redundant &nbsp; around <span> elements in buttons or links.
  4. Remove dark mode classes

    • Delete all dark:* classes (e.g., dark:bg-*, dark:text-*, dark:border-*).
  5. Replace inline SVG background data URLs with inline <svg> elements

    • Decode and insert the SVG as a proper inline <svg> element.
  6. Remove unnecessary wrapper <div> elements

    • Delete empty <div>s used only for hover overlays, unless essential.
  7. Reduce stacked spacing if excessive

    • Adjust mb-*, py-*, pt-*, etc., where large gaps exist.

๐Ÿ–ผ๏ธ Image Handling in Post Types

Single-Image Posts

  • Post Types: Articles, Blogs, Job Listings, Coupons, Soundcloud, Events, Discussions, Videos
  • Database Table: data_posts
  • Variables:
    • post_title: Title of the post
    • post_content: Body/content
    • post_image: Featured image

Image Support: One featured image. More can be added via the content editor.


Multi-Image Posts

  • Post Types: Classifieds, Properties, Products, Photo Albums, Digital Products
  • Database Table: users_portafolio_groups
  • Variables:
    • group_name: Title of the post
    • group_desc: Content/description
    • post_image: Comma-separated list of images

Image Support: Supports galleries with multiple images.`