visuellverstehen / statamic-anchor-navigation Goto Github PK
View Code? Open in Web Editor NEWStatamic Anchor Navigation is a Statamic addon that helps you build a server side anchor navigation from your bard content.
License: MIT License
Statamic Anchor Navigation is a Statamic addon that helps you build a server side anchor navigation from your bard content.
License: MIT License
Hi
Great add-on, quick question, where do I edit (or add) this?
'heading' => [
'levels' => [2],
],
I'd like to output h2 and h3. would the correct format be
'heading' => [
'levels' => [2, 3],
],
Hi,
Spotted an issue where an empty heading node would throw an error for no content. This was for entries with linked content , and the content had empty headings.
Undefined property: stdClass::$content
fix was to add an extra check on line 22 of src/Nodes/Heading.php
to check that content node exists
if (property_exists($node, 'content') && property_exists($node->content[0], 'text') && !is_null($node->content[0]->text)) {
$HTMLAttributes['id'] = Str::slug($node->content[0]->text);
}
Happy to create a PR if needed, Thanks for this addon!
Without being a hundred percent sure. In some cases the yaml structure of a heading seems to be missing the text key value pair.
This produces an error while indexing the content for the search index.
This error occurs if the anchor_navigation
-Tag is called in a context without an id.
Within the tag we're looking for the entry id within the tag context (see here):
if (! $this->entry = $this->context->get('entry_id')->augmentable()) {
return null;
}
That seems to work perfectly fine in the frontend โ however, when using the live preview, the entry_id
key can not be found within the context. You can find however a key id
, which seems to contain the same information. Changing that key should fix this.
Tested in both 3.4 and 4.1, in an existing project and in a fresh install. I don't know if that bug has always been there and we haven't noticed that before, or if any changes caused that problem.
Thanks for this extension. It's super easy to implement and works very well.
I was just wondering if you could think of a way to also include content that is stored within a set in bard.
Thanks for your time
Hi there,
Thanks for this nice addon, it's very easy to use, and does its job almost perfectly. Is say almost, because I have run into an issue when using it inside of a replicator field. If I do that, it throws the following error: Call to a member function augmentable() on string
, which seems to occur on vendor/visuellverstehen/statamic-anchor-navigation/src/Tags/AnchorNavigation.php:30
.
I have tried to understand what's going on there, but I could not find out in the limited time I have available. Any ideas?
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.