Skip to content

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
@crftwrk crftwrk added this to v6.3.0 May 29, 2025
@crftwrk crftwrk removed this from v6.2.0 May 29, 2025
@crftwrk crftwrk moved this to Todo in v6.3.0 May 29, 2025
@crftwrk crftwrk added this to v6.4.0 Aug 5, 2025
@crftwrk crftwrk removed this from v6.3.0 Aug 5, 2025
@crftwrk crftwrk moved this to Todo in v6.4.0 Aug 5, 2025
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?

2 participants