Comments (20)
You are correct -- the plugin just merges the custom values into meta array using the pico plugin file_meta()
the get_pages() function grabs the original meta only, making the adv-meta values unavailable in the pages loop... I will look into a fix.
from adv-meta.
Would be great if you could get this working, I really want to use Pico but need access to custom values on the homepage
from adv-meta.
I'm hoping there is a big update to the main repo of Pico with all of the suggested (& implemented) updates, or at least a fork that includes them.
from adv-meta.
Hopefully I get some time to look into this issue soon... I have been using a work-around (hack) for some time now here is what it looks like https://gist.github.com/shawnsandy/6282545, this might work for you until I can update the plugin or fork it which might be a good idea.
from adv-meta.
Updated the gist to include {{ page.type }} {{ page.slug }} and {{ page.category }}...
from adv-meta.
I'm using this fork that has custom fields built in and allows use as {{ page.type }} etc.
from adv-meta.
I really like his method get_pages()
-- merged it into my pico.php file and kept my the read_file_meta()
the same, using custom_meta_values set in the config... just not too comfortable with page creators being able to set the meta values...
from adv-meta.
Are you referring to setting the meta values on the fly, on a per post/page
basis? You prefer to have the usable ones set in the config file?
If this is your 'concern' I can understand. I guess it really depends on if
the site has a single user or many.
from adv-meta.
It's more of a preference, if you think of it pages are created by the end-user who may or may not be web designers/developers -- meta values can really only be used by a developer/designer creating the theme, making it a design/development task. I just hate giving access to such task(s) to the end user no matter how harmless they may seem...
from adv-meta.
Does v0.7 fix this? I still can't seem to access the custom variables in the loop ( {% for page in pages %} ) only on the single pages.
from adv-meta.
See commit -- a18b567
Yes v0.7 does fix these issues (thanks https://github.com/gilbitron) --- now the plugin just makes it easier to add and use custom meta values without the need to fork and change core files.
You cannot access {{ meta.value }}
in page loops, meta.value are for single pages you can use {{ page.meta_value }}
to access custom meta values in a page loop...
Hope this helps!
from adv-meta.
I guess it's just me then. I've tried that to death, even with the stock core pico & adv-meta files using the example you provided in the readme and it won't work. The values appear on single pages with {{ meta.value }}
but not in the loop with {{ page.meta_value }}
.
No worries. I'm a newbie and will figure it out sooner or later.
from adv-meta.
It may not be you it could be an error in the plugin code, make sure you get the latest relase... can you post a gist of your code I will see if i can replicate the issue...
thanks!
https://github.com/shawnsandy/adv-meta/archive/master.zip
from adv-meta.
Hi, just had a go on a fresh install (at work) and it looks like {{ page.meta_value }}
is returning the values for the current page for every page in the loop. I tried it on the navigation in the default template:
{% for page in pages %}
<li><a href="{{ page.url }}">{{ page.title }} | {{ page.type }} | {{ page.slug }}</a></li>
{% endfor %}
which prints the 'type' and 'slug' from the page you're viewing into each menu item.
from adv-meta.
John, are you seeing the correct values???
from adv-meta.
I'm getting the correct values for the page I'm viewing, so on the homepage, where 'type: page' and 'slug: homepage', I get:
<li><a href="http://localhost/vhosts/pico/">Welcome | page | homepage</a></li>
<li><a href="http://localhost/vhosts/pico/sub/">Sub Page Index | page | homepage</a></li>
<li><a href="http://localhost/vhosts/pico/sub/page">Sub Page | page | homepage</a></li>
The other two pages have different values set which you can see by viewing them.
Thanks for your help btw
from adv-meta.
Hey John, there is still an issue there, what you should be seeing is the meta value of each page, download the latest commit that should fix it, please let me know if you are still having issues
Here is what it should look like :-
<aside>
<h1 class=""><a href="http://localhost/pico-master/pico">Welcome</a></h1>
<p>Meta- Values : Type - page - Slug - home</p>
</aside>
<aside>
<h1 class=""><a href="http://localhost/pico-master/sample-page">Sample Page</a></h1>
<p>Meta- Values : Type - Blog - Slug - sample-page</p>
</aside>
...
from adv-meta.
The most recent commit fixed it for me.
Thanks for looking into this.
Cheers,
Kevin
from adv-meta.
Glad to hear it Kvanlierop.. NP...
from adv-meta.
Fixed, thanks alot
from adv-meta.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adv-meta.