Join the Webstudio community

Home
Members
Richard
R
Richard
Offline, last seen 4 weeks ago
Joined December 13, 2024
Hi, when I try to put the code below in an HTML Embed, I get "Unexpected token" as an error. Have I understood how to use the backticks and $ sign correctly? Thanks in advance



<style>
.accordion-header {
background-color: #f4f4f4;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
text-align: left;
border: none;
outline: none;
transition: 0.4s;
}
.accordion-header:hover {
background-color: #ddd;
}
.accordion-content {
padding: 0 18px;
background-color: white;
display: none;
overflow: hidden;
}
.accordion-header:after {
content: '\002B';
color: #777;
font-weight: bold;
float: right;
margin-left: 5px;
}
.active:after {
content: "\2212";
}
</style>
<div class="accordion-item">
<button class="accordion-header"></button>
<div class="accordion-content">
<p>${Collection Item["Review_1_Name"]}</p>
</div>
</div>
<script>
document.addEventListener('click', function(e) {
if (!e.target.matches('.accordion-header')) return;

e.target.classList.toggle('active');
var content = e.target.nextElementSibling;
if (content.style.display === 'block') {
content.style.display = 'none';
} else {
content.style.display = 'block';
}
});
</script>
7 comments
O
R
Hi, is it possible to get the slug variable to go in /post/:slug from a Resource rather than GraphQL?

Context is I'm testing out Pocketbase https://pocketbase.io which doesn't have GraphQL, only an API

Thanks in advance
7 comments
O
R
The Supabase with Webstudio video you guys did was great to get me started, I've successfully got data onto the page from Supabase, with no database experience.

But it didn't mention how to get dynamic URLs.

From the Wordpress video, I know its something to do with putting :slug in the URL, and generating GraphQL to somehow map a slug field to SLUG

But I'm stuck after trying so many different things. Any tips please?
13 comments
M
c
O
R