gtag('js', new Date());gtag('config', 'AW-1070396128'); Vegan Crab Cake Sliders

Vegan Crab Cake Sliders

This post was originally published on this site

These vegan crab cake sliders are small but mighty—crunchy, savory, and ready to disappear in record time. They bring a seafood-style flair with zero actual seafood—just hearts of palm, a few pantry items, and a killer sauce.

A hand holding a wooden tray of vegan crab cake sliders with toasted buns and dripping sauce.

Vegan seafood magic, but make it mini. These vegan crab cake sliders are crisp on the outside, tender in the middle, and stacked on toasted buns with a creamy, zesty sauce that ties everything together. They’re made with hearts of palm (our go-to for all things vegan seafood), crushed saltines, and Old Bay for that familiar flavor you know and love—without the actual crab. Whether you’re serving them for brunch, game day, or dinner-for-two, these sliders have a way of disappearing fast.

Some recipes are made for parties. This one might be the reason you throw one. With its golden sear, flaky texture, and tangy sriracha-caper sauce, these crabless patties bring main dish energy in appetizer form. Pair them with crisp lettuce and a squeeze of lemon—or just grab a napkin and go in hands-first. Either way, they hit just right every time.

Why You’ll Love These Vegan Crab Cake Sliders

These vegan crab cake sliders are proof that tiny sandwiches can absolutely steal the show. Whether you’re serving them at a dinner party or just throwing a party for yourself, they check off all the marks: crispy, flaky, buttery, and bold. Think seafood vibes without the seafood—just as satisfying, maybe even more. Here’s why you’ll love them:

  • Hearts of palm = plant-based seafood magic: Their naturally flaky texture makes them the perfect stand-in for crab—no weird fillers, no faux meat, just straight-up delicious.
  • Crispy on the outside, tender on the inside: Thanks to hand-crushed saltines and a quick fry, you get that golden, crunchy exterior with a soft, savory middle that holds together beautifully.
  • The slider format is low-effort, high-reward: Bite-sized and brunch-friendly, these work just as well for laid-back snacking as they do for special occasions.
  • Old Bay + dill = that signature flavor combo: The seasoning does the heavy lifting to give you those unmistakable crab cake vibes, and it plays perfectly with the creamy, tangy sauce on top.
  • Vegan, simple ingredients, no compromise: You don’t need anything fancy here. Just some basic pantry staples, and you’ll be on your way to crispy slider bliss in under 45 minutes. It’s everything you want in a vegan seafood appetizer—bold flavor, flaky texture, and party-perfect presentation.

Key Ingredients

These vegan seafood sliders keep it simple but smart, using pantry staples and clever substitutions to deliver big flavor in tiny sandwich form. Every ingredient pulls its weight—no fluff, no fillers, just the good stuff that makes these hearts of palm crab cake sliders shine. Here’s what you’ll need:

Close-up of canned hearts of palm arranged in a row on a white plate.
  • Hearts of Palm: The flaky foundation. These tender, softly textured stalks are the ultimate plant-based stand-in for crab. Once smashed and chopped, they mimic that delicate seafood texture so well, it almost feels suspicious. Pro tip: Look for sustainably harvested brands—some will say it right on the label.
  • Crushed Saltines: More than just a nostalgic snack—these hand-crushed crackers act as a binder, helping the patties hold together while adding just the right crunch. They also bring a salty, savory layer that balances the creamy mayo and punchy seasonings.
  • Old Bay Seasoning: This iconic spice blend brings the seafood flavor vibes. Its mix of celery salt, paprika, and pepper is what makes these taste like the real deal. Don’t skip it—this is where the crab cake magic really kicks in.
  • Fresh Dill: Bright, herby, and slightly citrusy, dill adds a pop of flavor that pairs beautifully with the richness of the mayo and the savory crunch of the crab cakes. It’s subtle, but it makes a difference.
  • Vegan Mayo: Adds creaminess and moisture to the crab cake mixture, and stars again in the special sauce. It’s the smooth operator that holds everything together—literally and flavor-wise.
  • Apple Cider Vinegar: A small splash of acid makes a huge impact. It lifts the whole mixture, brightens the dill and Old Bay, and helps cut through the richness. Acid is one of the keys to balancing fat in a dish—it hits a different set of taste buds than salt or spice, making everything pop just a little more.

How to Make Vegan Crab Cake Sliders

These vegan hearts of palm sliders come together with simple steps and pantry-friendly ingredients—but the end result feels way more impressive than the effort it takes. Here’s what you’ll do. For full recipe details, scroll to the end of this post!

  • Step 1: Prep the hearts of palm. Drain your can of hearts of palm, then smash each piece with the flat side of a knife and give them a rough chop. You want texture here—think flaky, not mushy.
  • Step 2: Make the crab cake mixture. Fold the hearts of palm together with crushed saltines, vegan mayo, Old Bay, dill, and a splash of vinegar. The mixture should hold together but still feel light and flaky. Once it’s mixed, don’t let it sit—use it right away for the best texture and to prevent them from falling apart when frying.
  • Step 3: Form the cakes. Gently shape the mixture into slider-sized cakes. If they’re a little soft, that’s okay—they’ll firm up once they hit the hot oil.
  • Step 4: Fry until golden. Heat a few inches of neutral oil in a heavy pot over medium-high heat. Once the oil is hot, gently lower the crab cakes in and fry in batches until deeply golden and crisp—about 2–3 minutes per side. Use a skimmer to move them around and a wire rack for draining after.

The Chopstick Trick: Is Your Oil Ready For Frying?

For crispy, golden crab cakes, you’ll want your oil heated to about 375°F (190°C). No thermometer? No problem. Here’s an easy way to check:

  • Heat a few inches of neutral oil in a Dutch oven or heavy-bottomed pot over medium-high for about 7 minutes.
  • Dip a wooden chopstick into the oil so the tip touches the bottom of the pot.
  • If you see steady bubbles forming around the chopstick right away, your oil is ready. If it’s quiet or sluggish, give it another minute and test again.
A golden-brown vegan crab cake fresh from the fryer on a mesh skimmer, cooling on a wire rack.
  • Step 5: Toast the buns. Give your slider buns a quick toast in a skillet with a little vegan butter or olive oil. This adds crunch, warmth, and the perfect surface for sauce.

The Sauce That Seals the Deal

Three ingredients. One bowl. Infinite swagger. This creamy, spicy, salty magic turns the sliders from oh, nice to whoa, I need another one. Just stir together vegan mayo, sriracha, and a spoonful of chopped capers. That’s it!
  • Step 6: Build your sliders. Add your crispy crab cake, drape it in the sauce, and finish with greens and a squeeze of lemon if you like. Stack, serve, and get ready for everyone to ask for seconds.
A hand holding a single vegan crab cake slider against a black background.

How To Serve These Vegan Seafood Sliders

These sliders might be small, but they know how to show up. Whether you’re hosting friends, making a snacky dinner, finger food, or just a little something for yourself with a fizzy drink on the side, these bring that casual-lux energy. Keep it classic or dress them up—either way, they’re going to be gone fast.

  • Go classic: A toasted bun, special sauce, and maybe some arugula or butter lettuce. That’s all you need for peak slider perfection.
  • Add a little crunch: A spoonful of tangy slaw is a solid move. It adds brightness and crunch that plays well with the crispy crab cake.
  • Swap the sauce: Not into spicy? Try cocktail sauce or vegan tartar sauce instead. Both give seafood vibes without competing for attention.
  • Play with toppings: Think pickled vegetables, a few thin cucumber rounds, or a chipotle-lime sauce. You really can’t go wrong here.
  • Make it a meal: Serve with fries, chips, a side of potato salad, or a simple fruit salad. Bonus points for a lemon wedge and cold drink.

FAQs

What are vegan crab cake sliders?

Vegan crab cake sliders are plant-based mini sandwiches made with a seafood-style patty using ingredients like hearts of palm instead of crab meat. The patties are seasoned with Old Bay, dill, and other classic flavors, then fried until golden and served on slider buns with a creamy sauce. They offer a similar texture and flavor to traditional crab cakes, without using any animal products.

What to serve with vegan crab cake sliders?

Popular side dishes for vegan seafood sliders include coleslaw, kettle chips, corn on the cob, or dill potato salad. They also pair well with grilled vegetables, cucumber salad, or a light green salad. For dipping, you can serve them with cocktail sauce or extra vegan mayo-based sauces.

How do you keep vegan crab cakes from falling apart?

To help vegan crab cakes hold their shape, it’s important to avoid refrigerating the mixture and use it right away. Crushed saltines act as a binder to absorb excess moisture and help the cakes stay firm during frying. Gently forming the patties and handling them with care while frying also prevents breakage.

Vegan crab cake slider with sriracha bottle and a tall glass of beer in the background.

More Vegan Seafood Recipes

I hope you love this vegan crab cake sliders recipe! If you make it, we’d love it if you left a review and star rating below to help others find and fall in love with it too. Your support means a lot!

Print

A vegan crab cake slider on a wooden board.

Vegan Crab Cake Sliders


5 Stars 4 Stars 3 Stars 2 Stars 1 Star

5 from 1 review


  • Author:
    erin wysocarski


  • Total Time:
    35 minutes


  • Yield:
    4 crab cakes


  • Diet:
    Vegan

const share_pin_buttons = document.getElementsByClassName( ‘share-pin button’ );
if ( share_pin_buttons ) {
for ( let share_key = 0; share_key {
e.stopPropagation();
window.open(e.target.dataset.href,’targetWindow’,’toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=500′);
return false;
} );
}
}

Description

These vegan crab cake sliders are crispy, flaky, and loaded with classic crab cake slider flavor—minus the seafood. Made with hearts of palm, Old Bay, and a creamy, punchy sauce, they’re the perfect vegan seafood appetizer for any occasion.


Ingredients

For the crab cakes

  • ¼ cup vegan mayo
  • ¼ teaspoon dried dill
  • ¼ teaspoon apple cider vinegar
  • 1 (14 oz.) can hearts of palm, halved, smashed with the flat side of a knife, then roughly chopped
  • 2 teaspoons Old Bay seasoning
  • 10 saltine crackers, crushed by hand

For frying

  • Canola, grapeseed, or vegetable oil, for frying

For the special sauce

  • ¼ cup vegan mayo
  • 2 teaspoons capers, chopped
  • ½ teaspoon sriracha

To serve

  • Slider buns, toasted with vegan butter or olive oil
  • Arugula, microgreens, or butter lettuce (optional)
  • Lemon wedges (optional)


Instructions

To prep the crab cake mixture

  1. In a small bowl, whisk together the vegan mayo, dill, and apple cider vinegar.
  2. Place the chopped hearts of palm into a separate medium bowl and season with Old Bay.
  3. Gently fold in the crushed saltines.
  4. Add the mayo mixture to the hearts of palm and fold again until combined.
  5. Form the mixture into 4 slider-sized crab cakes and set aside.
  6. Use the mixture immediately: Do not refrigerate or let it sit for too long, or it will affect the texture and ability to hold up when frying.
  1. Fill a medium Dutch oven or cast iron pot with several inches of neutral oil.
  2. Heat the oil over medium-high heat until it reaches 375°F (about 7 minutes).
  3. To test for readiness, insert a wooden chopstick so it touches the bottom—if bubbles form immediately, it’s ready to fry.
  4. Place one crab cake onto a skimmer and gently lower it into the oil. Add a second if desired, but limit batches to 1–2 at a time.
  5. Fry for 2–3 minutes, or until deeply golden, gently moving the crab cakes around with the skimmer.
  6. Transfer to a baking sheet lined with a wire rack to drain. Repeat with remaining cakes.

To toast your slider buns

  1. Preheat a cast iron skillet over medium heat.
  2. Add a thin layer of vegan butter or olive oil to coat the bottom.
  3. Working in batches, toast the buns until golden, pressing gently with your hand or a spatula for even contact.

To serve

  1. Spread about a tablespoon of special sauce onto each bun.
  2. Add a crab cake and top with greens and lemon wedges, if desired.

Notes

  • Use the mixture immediately: For best results, form and fry the crab cakes as soon as the mixture is made. Chilling or letting it sit too long can cause the cakes to fall apart during frying and lead to a mushy texture.
  • Reheating tips: These are best fresh, but leftovers can be crisped up for 10-15 minutes in a 375°F oven or an air fryer for 5–7 minutes. A hot skillet with a little oil also works well for a quick stovetop refresh.
  • Oil temperature trick: Don’t have a thermometer? Use the chopstick method—dip a wooden chopstick into the oil so it touches the bottom. If bubbles form around it right away, your oil is hot and ready (about 375°F).
  • Slider size: This recipe makes 4 thick slider-sized crab cakes. You can easily double the batch for a party or form them smaller for appetizer bites.
  • Serving tip: These crab cakes are rich and flavorful, so a squeeze of lemon or a handful of arugula adds a fresh contrast. Try them with cocktail sauce or vegan tartar for a fun twist on the classic slider.

  • Prep Time: 15 minutes
  • Cook Time: 20 minutes
  • Category: Lunch, Dinner
  • Method: Fried
  • Cuisine: American

window.trCommon={“minRating”:6,”ajaxurl”:”https://olivesfordinner.com/wp-admin/admin-ajax.php”,”ratingNonce”:””,”postId”:10044};
window.TastyRecipes = window.TastyRecipes || {};

window.TastyRecipes.smoothScroll = {
init() {
document.addEventListener( ‘click’, ( e ) => {
let anchor = e.target;
if ( anchor.tagName !== ‘A’ ) {
anchor = anchor.closest( ‘a.tasty-recipes-scrollto’ );
}

if ( ! anchor || ! anchor.classList.contains( ‘tasty-recipes-scrollto’ ) ) {
return;
}

const elementHref = anchor.getAttribute( ‘href’ );
if ( ! elementHref ) {
return;
}

e.preventDefault();
this.goToSelector( elementHref );
});
},
goToSelector( selector ) {
const element = document.querySelector( selector );
if ( ! element ) {
return;
}
element.scrollIntoView( { behavior: ‘smooth’ } );
}
};

document.addEventListener(
‘DOMContentLoaded’,
() => window.TastyRecipes.smoothScroll.init()
);

window.TastyRecipes = window.TastyRecipes || {};
window.TastyRecipes.cookMode = {
wakeLockApi: false,
wakeLock: false,
cookModeSelector: ‘.tasty-recipes-cook-mode’,
init() {
if (“wakeLock” in navigator && “request” in navigator.wakeLock) {
this.wakeLockApi = navigator.wakeLock;
}

const cookModes = document.querySelectorAll(this.cookModeSelector);

if (cookModes.length > 0) {
for (const cookMode of cookModes) {
if (this.wakeLockApi) {
cookMode.querySelector(‘input[type=”checkbox”]’).addEventListener(“change”, event => {
this.checkboxChange(event.target);
}, false);
} else {
cookMode.style.display = “none”;
}
}
}
},
checkboxChange(checkbox) {
if (checkbox.checked) {
this.lock();
} else {
this.unlock();
}
},
setCheckboxesState(state) {
const checkboxes = document.querySelectorAll(this.cookModeSelector + ‘ input[type=”checkbox”]’);
for (const checkbox of checkboxes) {
checkbox.checked = state;
}
},
async lock() {
try {
this.wakeLock = await this.wakeLockApi.request(“screen”);
this.wakeLock.addEventListener(“release”, () => {
this.wakeLock = false;
this.setCheckboxesState(false);
});
this.setCheckboxesState(true);
} catch (error) {
this.setCheckboxesState(false);
}
},
unlock() {
if (this.wakeLock) {
this.wakeLock.release();
this.wakeLock = false;
}
this.setCheckboxesState(false);
}
};

(function(callback) {
if (document.readyState !== “loading”) {
callback();
} else {
document.addEventListener(“DOMContentLoaded”, callback);
}
})(() => {
window.TastyRecipes.cookMode.init();
});

window.TastyRecipes = window.TastyRecipes || {};

window.TastyRecipes.staticTooltip = {
element: null,
tooltipElement: null,
deleting: false,
init( element ) {
if ( this.deleting ) {
return;
}
this.element = element;
this.buildElements();
},
destroy() {
if ( ! this.tooltipElement || this.deleting ) {
return;
}

this.deleting = true;
this.tooltipElement.classList.remove( ‘opened’ );

setTimeout( () => {
this.tooltipElement.remove();
this.deleting = false;
}, 500 );
},
buildElements() {
const tooltipElement = document.createElement( ‘div’ );
tooltipElement.classList.add( ‘tasty-recipes-static-tooltip’);
tooltipElement.setAttribute( ‘id’, ‘tasty-recipes-tooltip’ );

const currentTooltipElement = document.getElementById( ‘tasty-recipes-tooltip’ );
if ( currentTooltipElement ) {
document.body.replaceChild( tooltipElement, currentTooltipElement );
} else {
document.body.appendChild( tooltipElement );
}

this.tooltipElement = document.getElementById( ‘tasty-recipes-tooltip’ );
},
show() {
if ( ! this.tooltipElement ) {
return;
}

const tooltipTop = this.element.getBoundingClientRect().top
+ window.scrollY
– 10 // 10px offset.
– this.tooltipElement.getBoundingClientRect().height;
const tooltipLeft = this.element.getBoundingClientRect().left
– ( this.tooltipElement.getBoundingClientRect().width / 2 )
+ ( this.element.getBoundingClientRect().width / 2 ) – 1;
const posLeft = Math.max( 10, tooltipLeft );
this.maybeRemoveTail( posLeft !== tooltipLeft );

this.tooltipElement.setAttribute( ‘style’, ‘top:’ + tooltipTop + ‘px;left:’ + posLeft + ‘px;’ );
this.tooltipElement.classList.add( ‘opened’ );

},
maybeRemoveTail( removeTail ) {
if ( removeTail ) {
this.tooltipElement.classList.add( ‘tr-hide-tail’ );
} else {
this.tooltipElement.classList.remove( ‘tr-hide-tail’ );
}
},
changeMessage( message ) {
if ( ! this.tooltipElement ) {
return;
}
this.tooltipElement.innerHTML = message;
}
};

window.TastyRecipes.ajax = {
sendPostRequest( url, data, success, failure ) {
const xhr = new XMLHttpRequest();
xhr.open( ‘POST’, url, true );
xhr.send( this.preparePostData( data ) );

xhr.onreadystatechange = () => {
if ( 4 !== xhr.readyState ) {
return;
}
if ( xhr.status === 200 ) {
success( JSON.parse( xhr.responseText ) );
return;
}

failure( xhr );
};

xhr.onerror = () => {
failure( xhr );
};
},
preparePostData( data ) {
const formData = new FormData();

for ( const key in data ) {
formData.append( key, data[key] );
}
return formData;
},
};

window.TastyRecipes.ratings = {
defaultRating: 0,
currentRatingPercentage: 100,
savingRating: false,
init( minRating ) {
this.minRating = minRating;

this.formWatchRating();
this.closeTooltipWhenClickOutside();
this.addBodyClassBasedOnSelectedRating();
this.backwardCompFormRatingPosition();
},
formWatchRating() {
const ratings = document.querySelectorAll(‘.tasty-recipes-no-ratings-buttons [data-rating]’);
if ( ratings.length {
event.preventDefault();
this.defaultRating = event.target.closest( ‘.checked’ ).dataset.rating;
this.setCheckedStar( event.target );
this.maybeSendRating( this.defaultRating, event.target );
this.setRatingInForm( this.defaultRating );
} );
}
},
closeTooltipWhenClickOutside() {
window.addEventListener( ‘click’, e => {
// Bailout (don’t remove the tooltip) when the clicked element is a rating star, or it’s the tooltip itself.
if ( e.target.closest( ‘.tasty-recipes-rating’ ) || e.target.classList.contains( ‘tasty-recipes-static-tooltip’ ) ) {
return;
}

window.TastyRecipes.staticTooltip.destroy();
} );
},
setRatingInForm( rating ) {
const ratingInput = document.querySelector( ‘#respond .tasty-recipes-rating[value=”‘ + rating + ‘”]’ );
if ( ! ratingInput ) {
return;
}
ratingInput.click();
},
addBodyClassBasedOnSelectedRating() {
const ratingInputs = document.querySelectorAll( ‘input.tasty-recipes-rating’ );
if ( ! ratingInputs ) {
return;
}
for ( const ratingInput of ratingInputs ) {
ratingInput.addEventListener( ‘click’, currentEvent => {
const selectedRating = currentEvent.target.getAttribute( ‘value’ );
this.handleBodyClassByRating( selectedRating );
this.toggleCommentTextareaRequired( selectedRating );
} );
}
},
handleBodyClassByRating( rating ) {
if ( rating < this.minRating ) {
document.body.classList.remove( 'tasty-recipes-selected-minimum-rating' );
return;
}
document.body.classList.add( 'tasty-recipes-selected-minimum-rating' );
},
toggleCommentTextareaRequired( rating ) {
const commentTextarea = document.getElementById( 'comment' );
if ( ! commentTextarea ) {
return;
}

if ( rating {
window.TastyRecipes.staticTooltip.changeMessage( response.data.message );
window.TastyRecipes.staticTooltip.show();
this.updateAverageText( response.data, recipeCardElement );
this.maybeFillCommentForm( response.data );

// Hide the tooltip after 5 seconds.
setTimeout( () => {
this.maybeResetTooltip( recipeCardElement, response.data, rating );
}, 5000 );
},
() => {
this.resetTooltip( recipeCardElement );
}
);
},
updateAverageText( data, recipeCardElement ) {
if ( ! data.average ) {
return;
}
this.setRatingPercent( data );

if ( ! data.count ) {
return;
}

const quickLink = document.querySelector( ‘.tasty-recipes-rating-link’ );
if ( quickLink ) {
this.setTextInContainer( quickLink, data );
this.setPartialStar( quickLink );
}

const cardStars = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
cardStars.dataset.trDefaultRating = data.average;
this.setTextInContainer( recipeCardElement.querySelector( ‘.tasty-recipes-rating’ ), data );
},
setTextInContainer( container, data ) {
if ( ! container ) {
return;
}

if ( data.label ) {
const ratingLabelElement = container.querySelector( ‘.rating-label’ );
if ( ratingLabelElement ) {
ratingLabelElement.innerHTML = data.label;
}
return;
}

const averageElement = container.querySelector( ‘.average’ );
if ( averageElement ) {
averageElement.textContent = data.average;
}

const countElement = container.querySelector( ‘.count’ );
if ( countElement ) {
countElement.textContent = data.count;
}
},
setPartialStar( container ) {
const highestStar = container.querySelector( ‘[data-rating=”‘ + Math.ceil( this.defaultRating ) + ‘”]’ );
if ( highestStar ) {
highestStar.dataset.trClip = this.currentRatingPercentage;
}
},
setRatingPercent( data ) {
this.defaultRating = data.average.toFixed( 1 );
const parts = data.average.toFixed( 2 ).toString().split( ‘.’ );
this.currentRatingPercentage = parts[1] ? parts[1] : 100;
if ( this.currentRatingPercentage === ’00’ ) {
this.currentRatingPercentage = 100;
}
},
setCheckedStar( target ) {
const cardRatingContainer = target.closest( ‘.tasty-recipes-ratings-buttons’ );
const selectedRatingElement = cardRatingContainer.querySelector( ‘[data-tr-checked]’ );
if ( selectedRatingElement ) {
delete selectedRatingElement.dataset.trChecked;
}

const thisStar = target.closest( ‘.tasty-recipes-rating’ );
thisStar.dataset.trChecked = 1;
thisStar.querySelector( ‘[data-tr-clip]’ ).dataset.trClip = 100;
},
maybeFillCommentForm( data ) {
if ( ! data.comment || ! data.comment.content ) {
return;
}

const commentForm = document.querySelector( ‘#commentform’ );
if ( ! commentForm ) {
return;
}

const commentBox = commentForm.querySelector( ‘[name=comment]’ );
if ( ! commentBox || commentBox.value ) {
return;
}

// Add comment details for editing.
commentBox.innerHTML = data.comment.content;
if ( data.comment.name ) {
commentForm.querySelector( ‘[name=author]’ ).value = data.comment.name;
commentForm.querySelector( ‘[name=email]’ ).value = data.comment.email;
}
},
maybeResetTooltip( recipeCardElement, data, rating ) {
if ( this.savingRating === rating ) {
this.resetTooltip( recipeCardElement, data );
}
},
resetTooltip( recipeCardElement, data ) {
window.TastyRecipes.staticTooltip.destroy();
this.savingRating = false;

// Reset the default rating.
const cardRatingContainer = recipeCardElement.querySelector( ‘.tasty-recipes-ratings-buttons’ );
if ( cardRatingContainer ) {
this.defaultRating = ( data && data.average ) ? data.average.toFixed(1) : cardRatingContainer.dataset.trDefaultRating;
cardRatingContainer.dataset.trDefaultRating = this.defaultRating;

this.resetSelectedStar( cardRatingContainer, data );
}
},
resetSelectedStar( cardRatingContainer ) {
const selectedRatingElement = cardRatingContainer.querySelector( ‘[data-rating=”‘ + Math.ceil( this.defaultRating ) + ‘”]’ );
if ( selectedRatingElement ) {
selectedRatingElement.querySelector( ‘[data-tr-clip]’ ).dataset.trClip = this.currentRatingPercentage;
selectedRatingElement.parentNode.dataset.trChecked = 1;
}

const previousSelectedElement= cardRatingContainer.querySelector( ‘[data-tr-checked]’ );
if ( previousSelectedElement ) {
const currentSelectedRating = previousSelectedElement.querySelector(‘[data-rating]’);
if ( currentSelectedRating !== selectedRatingElement ) {
delete previousSelectedElement.dataset.trChecked;
}
}
},
backwardCompFormRatingPosition() {
const ratingsButtons = document.querySelector( ‘#respond .tasty-recipes-ratings-buttons, #tasty-recipes-comment-rating .tasty-recipes-ratings-buttons’ );
if ( ! ratingsButtons ) {
return;
}
const ratingsButtonsStyles = window.getComputedStyle(ratingsButtons);
if ( ! ratingsButtonsStyles.display.includes( ‘flex’ ) ) {
ratingsButtons.style.direction = ‘rtl’;
}

if ( typeof tastyRecipesRating !== ‘undefined’ ) {
// Select the rating that was previously selected in admin.
ratingsButtons.querySelector( ‘.tasty-recipes-rating[value=”‘ + tastyRecipesRating + ‘”]’ ).checked = true;
}

const ratingSpans = ratingsButtons.querySelectorAll( ‘.tasty-recipes-rating’ );
for (const ratingSpan of ratingSpans) {
ratingSpan.addEventListener( ‘click’, event => {
if ( ratingSpan === event.target ) {
return;
}
ratingSpan.previousElementSibling.click();
} );
}
}
};

(function(callback) {
if (document.readyState !== “loading”) {
callback();
} else {
window.addEventListener( ‘load’, callback );
}
})(() => {
window.TastyRecipes.ratings.init( window.trCommon ? window.trCommon.minRating : 4 );
});

This post was first published in 2021. The recipe is the same, but the writing is updated to provide clarity and helpful tips.

The post Vegan Crab Cake Sliders appeared first on Olives for Dinner.

Spice-Rack-Maker

View posts by Spice-Rack-Maker
Dave the spice rack maker. Lived and worked in central MN for 50 years, Enjoy the lakes and woods surrounding the spice rack makers wood shop.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top
meta name="facebook-domain-verification" content="9nsylso9191eittlniq02vrtednsij" />