bloke / smd_tags Goto Github PK
View Code? Open in Web Editor NEWA Textpattern CMS plugin for unlimited, structured taxonomy across content types.
License: GNU General Public License v2.0
A Textpattern CMS plugin for unlimited, structured taxonomy across content types.
License: GNU General Public License v2.0
The field labels on the admin panel(s) need to be rendered correctly so they can be hooked into _instruction
lang strings.
When passing smd_related_tags to a form like this:
<txp:smd_related_tags section="news" type="article" wraptag="" break="" form="detail_listitem" />
… the if_first_article
and if_last_article
containers in the linked form are not processed.
As far as I can tell, this is because the {content-type}['is_first']
and {content-type}['is_last']
array keys are not set by the plugin like they are in txplib_publish.php, and these are the triggers for the if_first / if_last functions.
Replicating the same pattern in the smd_related_tags
function of the plugin seems to produce the desired result for articles, e.g. adding a counter and setting the array keys in this code block. The function already saves the total matches in $contentCount
.
$itemCount = 0;
foreach ($rs as $row) {
if (!in_array($row['ID'], $uniqrs)) {
$itemCount++;
$safe = ($thisarticle) ? $thisarticle : NULL;
$thisarticle['is_first'] = ($itemCount == 1);
$thisarticle['is_last'] = ($itemCount == $contentCount);
populateArticleData($row);
$row['Title'] = ($no_widow) ? noWidow(escape_title($row['Title'])) : escape_title($row['Title']);
$out[] = ($form) ? parse_form($form) : (($thing) ? parse($thing) : href($row['Title'], permlinkurl($row)));
$uniqrs[] = $row['ID'];
$thisarticle = $safe;
}
}
Analog for the cases “image”, “file” and “link”.
Is that all it needs?
I get the following tag error notice on php 7.2:
Tag error: <txp:smd_tag_list parent='<txp:variable name="tag_language" />' wraptag="" break="">
<li><a href="<txp:site_url /><txp:variable name="tag_language" />/<txp:if_variable name="tag_language" value="referenzen">thema<txp:else/>topic</txp:if_variable>/<txp:smd_tag_name title="0" link="0" />"><txp:smd_tag_name title="1" link="0" /></a></li></txp:smd_tag_list> -> 8192: The each() function is deprecated. This message will be suppressed on further calls while parsing form reference_list_item on page references
I think it's referring to this line.
Might changing:
while (list($key, $row) = each($rs)) {
to:
foreach ($rs as $key => $row) {
resolve the error?
At the moment if 'auto name' is enabled and you enter a tag name with an accent the accented character will be removed from the generated name. This is a little annoying, as you have to go and add the unaccented version of the character yourself. This behaviour also feels inconsistent with the rest of Textpattern, for example the automatically generated 'URL-only title' replaces accented characters with their non-accented equivalent by itself.
This isn't a bug, but it would be a nice enhancement.
(I guess some people might want an 'ü' to convert to 'ue' instead 'u' (etc.), but I think just a simple replacement would be most useful.)
Received with TXP 4.9-dev on PHP 8.2. The error refers to line
Line 4139 in e21dd55
The title_no_widow
txp pref was removed in 2019 (see this issue and this commit).
Solution: Bring over that same change to smd_tags or if you want to support old versions, wrap in an @Isset@.
With PHP8 one encounters a ob_end_clean(): failed to delete buffer. No buffer to delete
error message on the manage tags pane.
The message refers to line 3044 which has an @
-error suppression operator in front of ob_end_clean()
. There are two further instances at lines 3116 and 3137.
Might this be a suitable replacement?
if(ob_get_length() > 0) {
while(ob_end_clean()); // Get rid of any page so far
}
There is a jQuery plugin requirement to use quick tag, the link goes to a 404 page.
However, you could probably do this better with native HTML5 autocomplete
attributes on the textarea
and also datalist
tags - negating the need for jQuery:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
Is this possible easily, given the number of ways that tags can be assigned to content?
https://forum.textpattern.com/viewtopic.php?pid=333021#p333021
Permits past/future and other date-based expressions to be passed forward to the related content.
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.