Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filters and actions to templates #85

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

crftwrk
Copy link
Member

@crftwrk crftwrk commented Aug 31, 2024

Closes #75

Filters

Swiper-container

/**
 * Change all hero template swiper-container classes
 */
function swiper_container_class() {
  return "height-75 mb-0";
}
add_filter('bootscore/bs-swiper/class/swiper-container', 'swiper_container_class', 10, 2);
/**
 * Change swiper-container class in a single hero file
 */
function swiper_container_class($string, $location) {
  if ($location == 'bs-swiper-hero-fade') {
    return "mb-5";
  }
  return $string;
}
add_filter('bootscore/bs-swiper/class/swiper-container', 'swiper_container_class', 10, 2);
/**
 * Change all hero template swiper-container classes
 */
function swiper_container_class() {
  return "height-75 mb-0";
}
add_filter('bootscore/bs-swiper/class/swiper-container', 'swiper_container_class', 10, 2);


/**
 * Change all hero template swiper-image classes
 */
function swiper_hero_image_class() {
  return "object-fit-cover h-100";
}
add_filter('bootscore/bs-swiper/class/swiper-hero-image', 'swiper_hero_image_class', 10, 2);


/**
 * Change all hero template overlay position classes
 */
function swiper_hero_overlay_class() {
  return "position-absolute top-0 end-0 bottom-0 start-0";
}
add_filter('bootscore/bs-swiper/class/swiper-overlay-position', 'swiper_hero_overlay_class', 10, 2);


/**
 * Change all hero template container classes
 */
function swiper_bs_container_class() {
  return "container h-100 d-flex justify-content-end align-items-end";
}
add_filter('bootscore/bs-swiper/class/container', 'swiper_bs_container_class', 10, 2);


/**
 * Change all hero template caption classes
 */
function swiper_caption_class() {
  return "bg-primary rounded-4 p-4 mb-5 w-50";
}
add_filter('bootscore/bs-swiper/class/swiper-caption', 'swiper_caption_class', 10, 2);


/**
 * Change all hero template heading class
 */
function swiper_caption_heading_class() {
  return "h1";
}
add_filter('bootscore/bs-swiper/class/swiper-caption/heading', 'swiper_caption_heading_class', 10, 2);


/**
 * Change all hero template heading link class
 */
function swiper_caption_heading_link_class() {
  return "text-danger text-decoration-none";
}
add_filter('bootscore/bs-swiper/class/swiper-caption/heading/link', 'swiper_caption_heading_link_class', 10, 2);


/**
 * Change all hero template excerpt link class
 */
function swiper_caption_excerpt_link_class() {
  return "text-info";
}
add_filter('bootscore/bs-swiper/class/swiper-caption/excerpt/link', 'swiper_caption_excerpt_link_class', 10, 2);

/**
 * Change all hero template excerpt link class
 */
function swiper_caption_button_class() {
  return "btn btn-outline-light w-100";
}
add_filter('bootscore/bs-swiper/class/swiper-caption/button', 'swiper_caption_button_class', 10, 2);

@crftwrk crftwrk added the documentation Improvements or additions to documentation label Aug 31, 2024
@crftwrk crftwrk marked this pull request as draft August 31, 2024 18:26
@crftwrk crftwrk changed the title Add filters to hero templates Add filters and actions to templates Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Remove mb-* classes from heroes?
1 participant