Code Monkey home page Code Monkey logo

smarttag's Introduction

SmartTag

Yet Another Tagging System for MODX Revolution

smarttag's People

Contributors

excaliburkg avatar goldsky avatar gr1ev0us avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

smarttag's Issues

Letter 'a' gets stripped from tag due to friendly_alias_restrict_chars_pattern

When I type in a tag which contains the letter 'a' in it, this letter gets stripped when I press enter. So, for example:

dance
will become
dnce

This is caused by the default friendly_alias_restrict_chars_pattern. In it's default state it is:
/[\0\x0B\t\n\r\f\a&=+%#<>"~:`@?[]{}|^']/

The \a is causing the 'a' to get stripped. When I remove the \a, the a's won't get stripped anymore.

I guess the \a&= needs to get grouped. I'm not a pro on regex, so I don't know how to properly group this.

This problem is caused by enhancement #13

Smarttag 1.0.0 rc1
MODX 2.2.15

System setting to rename CMP title and hide version number

To fully customise the CMP for client UX it would be useful to be able to hide the version number (its irrelevant to them) and rename the CMP from something like SmartTag to maybe Tag Management System or something more descriptive for clients

Rename Tag dialogue box should pre-populate the field with the old name

For long tags it would be useful if the Rename Tag box was already pre-filled with the tag that you want to modify. A bit like when you duplicate a resource it copies the old name ready to be edited. Sometimes just a spelling error or one character needs to be edited and not the entire tag.

Possible problem with tags containing a comma

Apologies is this is due to incorrect set up of input properties (in which case please let me know).

We're using several SmartTags in a development system where some tag values contain commas. When saving a resource containing a 'comma-based' tag (let's call this R1), the smarttag value is correctly added to the 'smarttag_tags' table along with association in table 'smarttag_tagresources'. All good so far. The document resource (R1) also correctly shows the comma-based tag in the manager interface after screen refreshes. All good.

Problem appears after editing another resource document (any) and then reloading the original R1 resource. No comma-based tags seem to appear in the manager interface - though any tags NOT containing commas do. If resource R1 is then edited and saved (any field - content, pagetitle etc.), then association to those non-displayed comma-based tags is lost in table 'smarttag_tagresources'.

We fixed the problem in our dev system by editing file 'modx_core/components/smarttag/elements/tv/mgr/input/tpl/smarttag.tpl'. We changed line 37 from ',valueDelimiter: ","' to ',valueDelimiter: "|"'.

Again, if this is related to input properties not being correctly set up, then apologies. Otherwise, can we suggest some kind of permanent fix in a future release?

We're currently running version 1.0.0-rc2.

Many thanks for a great component goldsky. Really is a big help for our particular system requirements.

Bug if using in MIGX

Dear developers. I found exception if using extension with MIGX.

In template
~/core/components/smarttag/elements/tv/mgr/input/tpl/smarttag.tpl line 12
$tv->id can be string type in MIGX.

For correct work need replace

,tvId: {/literal}{$tv->id}{literal} /* replace to --> _/ ,tvId: '{/literal}{$tv->id}{literal}' (_add quotes*)

Please correction this in next release.

Thank you very much for your extension! :-)

Get or keep the tags order

In the BO of modx, while editing a resource, in the TV tab, tags are appearing in the creation order.

I'm making a snippet to retrieve all tags for a resource id (in order to differently highlight the tags). How can I browse the tags of a resource in this same order ?

Thanks very much,
Lionel

when using "getResourcesTag" with "&tagSearchType=`exact`" I get no results when the resource has more than one tag

To show all the resources for a specific tag I use the "getResourcesTag" snippet from tagLister.
Since I want to use tags that are similar (like "air" and "pair"), I tried to use the property "&tagSearchType=exact" which works when the resource has only one tag. If the resource has more than one tag, I get no results.
Here is my snippet call:
[[!getResourcesTag?
&parents=50
&tagKey=airSmartTag
&tpl=air.SmartTagResults
&toPlaceholder=results
&tagSearchType=exact
&includeContent=1
&includeTVs=1
&showHidden=1
&hideContainers=1
&cache=0]]

If there is a built in functionality in SmartTag to achieve the same result as the "getResourcesTag" call, I'd be more than happy - unfortunately I couldn't find it.

MODX3 compatibility

From Slack:

Stuart McMartin 16:32
Just upgraded to 3.0.0. Smashing. Looks good.
I've a problem with some resources in the Manager. Best guess is something to do with Template Vars on offending resources.
And in the Error Log I get -

(ERROR @ /home/USER/apps/MyPROJECT/core/src/Revolution/modManagerResponse.php : 160) PHP warning: Invalid argument supplied for foreach()TypeError: Argument 1 passed to SmartTagInputRender::__construct() must be an instance of modTemplateVar, instance of MODX\Revolution\mysql\modTemplateVar given, called in /home/USER/apps/MYPROJECT/core/src/Revolution/modTemplateVar.php on line 473

Errors:

 SmartTagInputRender->__construct()
 MODX\Revolution\modTemplateVar->getRender()
 MODX\Revolution\modTemplateVar->renderInput()
 ResourceManagerController->loadTVs()
 ResourceUpdateManagerController->process()
 MODX\Revolution\modManagerController->render()
 MODX\Revolution\modManagerResponse->outputContent()
 MODX\Revolution\modManagerRequest->prepareResponse()
 MODX\Revolution\modManagerRequest->handleRequest()

Might be quickest solved by replacing the input constructor from:

    public function __construct(modTemplateVar $tv, array $config = array()) {

to

    public function __construct($tv, array $config = array()) {

but I haven't tested if that flags up any strict errors or if any other compatibility issues exist.

System setting to hide converter

It would be useful to be able to hide the Converter tab from certain user groups to prevent them from making breaking changes

When creating the table, custom table prefix is not respected

I found out that the tables 'modx_smarttag_tagresources' and 'modx_smarttag_tags' are created with the default prefix (modx_). I use a custom prefix for my tables, and this was not used in the table names. It resulted in Smarttag not working and a lot of errors in the error log.

MODX 2.2.14
Smarttag 1.0.0 (beta6)

parentIds doesn't not include deep children

Hi,

I want to select the tags of all children of one specific parent.
Even if the doc talk about a parentIds parameter, it doesn't include all the children :

[[!smarttagTags?
                 &parentIds=`129`
                 &includeHiddenDocs=`1`
                 &tplWrapper=`@code:[[+smarttag.tags]]`
                 &tplItem=`@code:<button class="button" data-filter=".tag-[[+smarttag.tag]]">[[+smarttag.tag]] <span>([[+smarttag.count]])</span></button>`
                 &tvNames=`EventTags`
]]

The other parameter allTags is working, but for ALL the resources of the website !

[[!smarttagTags?
                 &allTags=`1`
                 &includeHiddenDocs=`1`
                 &tplWrapper=`@code:[[+smarttag.tags]]`
                 &tplItem=`@code:<button class="button" data-filter=".tag-[[+smarttag.tag]]">[[+smarttag.tag]] <span>([[+smarttag.count]])</span></button>`
                 &tvNames=`EventTags`
]]

Is there a way to select all the tags of children of a specific resource, without specify each direct parents ?

Tag list on the page

Pretty strange question, but.. Am I able to put article's list of tags into the regular page? And create a page where all links to the articles will be listed, not in administration panel.

Feature Request: Associated tags

This might be suitable for a future version (1.1 or something) but it would be useful (and smart) if SmartTags could have "children" tags that are related to a parent tag, for example:

accessory (parent)
accessories (child)
accessorize (child)

or
shoe (parent)
shoes (child)

If the tags are being used for search and a child tag gets a hit then it would show the results for the parent tag.

Show all tags in a drop down list on click. Similar to the MODX Multi Select TV

CLient is confused by having to type. And it's true. WE have mixed behavior. Some fields have a drop down, others no, but both offer type ahead.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27355950-show-all-tags-in-a-drop-down-list-on-click-similar-to-the-modx-multi-select-tv?utm_campaign=plugin&utm_content=tracker%2F813270&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F813270&utm_medium=issues&utm_source=github).

Changing name of tag makes it not show up in the TV field

If I change a name of a tag, it gets changed in the smarttag_tags table, but it no longer shows up in the TV field for the resource. This is because the plugin stores the NAME of the tag, rather than the ID number, in the actual value in the site_tmplvar_contentvalues table, in the value field. Changing the name updates that tag in smarttag_tags, but the "value" field in site_tmplvar_contentvalues does not also get updated.

I don't understand why this plugin stores this information in two places, 1) site_tmplvar_contentvalues and 2) smarttag_tagresources. It would work better to not use site_tmplvar_contentvalues at all, and just join the two smarttag tables instead, and use those to load the tag names into the TV field on individual resources.

I assume you're doing some sort of lookup from the smarttag tables, and that that's why a tag with a changed name doesn't show up (because it is still in site_tmplvar_contentvalues under the old name), but if you're not loading the names from site_tmplvar_contentvalues to fill out the TV field on the resource editing page, why not use IDs instead?

Separate tegname and tagalias in DB.

Hi. Can you separate tagname and tagalias in DB. It's need for correct using national languages in tegname and english in tagalias. As long we have to use the national language in URL. This isn't very good...

Thanks!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/30524231-separate-tegname-and-tagalias-in-db?utm_campaign=plugin&utm_content=tracker%2F813270&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F813270&utm_medium=issues&utm_source=github).

Tags are transliterated from cyrillic to latin

Hi!
SmartTag version 1.0.1 pl.
When I add new value in TV in cyrilic, it automatically transliterated to latin.
For example, "новости" - "novosti".
image
When I hit Enter, tag is converted to
image

I need my tags in cyrillics.
For transliterating aliases I use "translit" extra from modx.com - http://modx.com/extras/package/translit.

I've got another site, SmartTag version 1.0.0 beta 6, I use "translit" extra too - and tags is saved in cyrillic, no problem.

What is wrong? Thanks for any advise

Fields are not correctly displayed

This tv fields are not correctly displayed when editing resource.
Screenshot
https://file.modx.pro/files/f/3/0/f30f37fa4ea7fd996840d48f4009e04e.jpg

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/30940705-fields-are-not-correctly-displayed?utm_campaign=plugin&utm_content=tracker%2F813270&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F813270&utm_medium=issues&utm_source=github).

Same tag name from different TVs causes tag total miscount

Summary

When there are two different SmartTag TVs (e.g. keywords and country) and some tag names are used across both TVs, then the total counts can sometimes be wrong.

For example keywords has the games, art, Indonesia and country has Indonesia; when calling a snippet like this:

[[!smarttagTags?
    &parentIds=`1`
    &limit=`50`
    &tvNames=`keywords`
]]

The resulting list should just show Indonesia (1) since this is tagged once within the keywords TV, however the final count is Indonesia (2) because it actually counts across all SmartTag TVs not just the specified TV in &tvNames.

Environment

MODX version 2.4.0-pl, SmartTag 1.0.4-pl

How can I link to a page that contains all resources with tag X?

I want to create a page which lists all the resources with a specified tag. (just like you could do with getResourcesTag for tagLister). How do I do this? Is there a specific snippet to use? And how can I make the tags link to that page? I have set the output type of the tv to 'smarttag' and I've filled in the href (I placed [[~18]] there, 18 is the resource which should list all the resources with that tag). However each tag just links to that page, there is no parameter added to the url so we don't know for what tag the resources should be collected.

Thanks for any help!

Type ahead feature is too 'helpful'

When I add fox as a tag for one page, and then want to add ox for another, the type ahead feature suggests I use fox instead. No matter how hard I try, it won't let me enter anything else but fox. The only way to fool it is to accept fox, then add ox and then remove fox again. If you have many words containing the letters 'ox' that could become annoying very quickly.

Besides having the freedom to override the suggestion, it might also be more convenient if the type ahead feature searches for tags that begin with, rather than contain the typed phrase,

count does not honor tvnames

count of resources does not honor tvnames passed in
the subqueries need to support this within it.

(empty($tvNames) ? '': 'AND smarttagTagresources.tmplvar_id =TemplateVar.id') .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.