Coder Social home page Coder Social logo

jako / toggletvset Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pepebe/toggletvset

11.0 4.0 3.0 6.05 MB

Toggle a set of MODX TVs depending on the value of a Single Select TV

Home Page: https://jako.github.io/ToggleTVSet/

PHP 60.38% JavaScript 21.85% Smarty 2.85% CSS 10.44% SCSS 4.48%
modx-revolution modx modx-extra

toggletvset's Introduction

ToggleTVSet

Toggle the visibility of template variables sets by the value of a template variable.

Features

See this Movie for a short introduction.

For more information please read the documentation.

Installation

MODX Package Management

Usage

Install via package manager

toggletvset's People

Contributors

intersel avatar jako avatar jsdelivrbot avatar umnic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

toggletvset's Issues

[FEATURE] ToggleTVSet to work with bindings (@SELECT)

Problem
When the value of a toggle tv set is updated, all resources with that assigned tv need resetting (this is default MODX behaviour, nothing todo with ToggleTVSet). This is problematic when you have a site with a large amount of resources which all need changing (more info here).

Solution
Allow ToggleTVSet to work with something such as SetInputOptions. SetInputOptions gives you a CMP which allows you to manage values of a TV, by inserting a query statement in the input field of a TV. These values are stored in the database.

A more generic summary is to enhance ToggleTVSet so it can use @SELECT query statements in an input field of a TV, so it can retrieve the values from the database.

Observed Behaviour
At the moment using a @SELECT query statement inside a ToggleTVSet TV causes some problems, such as;

  1. On initial load - all TV's are displayed
  2. After save, the "hideTVs" option in the <head> doesn't pull in the TV ID's, which means the TVs aren't hidden in the manager any more.
  3. "showTVs" value is displaying an incorrect TV ID

What works:

  1. The toggle sets toggle, but when selected and saved, all tv's are displayed again
  2. Using a query statement, the name of the options appear to be loading in fine (but perhaps the value isn't being pulled in)

ToggleTVSet not working for all users!

My problem is that the toggletvset not correctly for all users.
I have a admin and user account for my client with limitations to some resources.

But if I use ToggleTVSet it is working correct for the admin but not for my client.

ToggleTVSet 2.0.1 requires PHP 7.4 but has PHP 7.2 listed as dependency

When testing ToggleTVSet 2.0.1 we were getting:

( ! ) Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST) in [path_to_core]/core/components/toggletvset/src/Snippets/Snippet.php on line 35

It seems like the trouble is that we are running PHP 7.3.x and Snippet.php uses Typed Properties which were introduced in PHP 7.4 on line 35 and 41.

We'll be upgrading PHP everywhere soon but wanted to report this in the interest of being helpful.

ToggleTVSet is not working in the manager on MODX 2.8.4

ToggleTVSet 2.0.0-pl and 2.0.2-pl does not work properly in the manger and displays all options.
We have no error in the console, the issue occurs on new resources as well as existing resources, and it sometimes fixes itself when you resize the browser but not always.

ToggleTVSet-2.0.4 Temporarily Displays Previous Options After Saving Resource

ToggleTVSet-2.0.4 has an issue where if you toggle an option and save the resource, the ToggleTVSet shows the previously set option instead. On page refresh, the ToggleTVSet then displays everything as normal.

Our apologies as this issue may have been caused by the solution proposed here #13

EDIT: We also have not been able to reproduce our original issue, so reverting the timeout may be fine.

ToggleTVSet broken on modx 2.8.4

Hi,

I'm using ToggleTVSet version 2.0.0 on Modx 2.8.4.

The first time the toggle works fine and the tv's are showing/hiding as expected, but after saving and reloading the page/resource the tv's are hidden again. When I look at the error log, Ext JS is throwing this error:

image

image

I'm using Chome latest version (104.0.5112.79) on different platforms (Windows and OSX).

Toggle TV returns label when value is blank

I have a TV with these input values: No==||Yes==10

If 'No' is selected and the Input type is Listbox, the TV value is empty.

When I switch the Input type to Toggle TV, the TV value is 'No.'

I think both input types should return the same value.

ToggleSet out of sync when a new TV is added

I have a TV Toggle setup like this;

Please select...==||Event==43,58,49,47,48,42,12,13,52,53,54,51,56,57,55,11,15,16,17,18,44,45,46||Coming Soon==12,16

It's assigned and set to over 200 resources. If I need to add a new TV id to the above toggle set, this happens;

screen shot 2017-03-09 at 21 16 11

Resources that were set to "Event" are now set to "43,58,49,47,48,42,12,13,52,53,54,51,56,57,55,11,15,16,17,18,44,45,46". The TV ID's disappear from the drop down, if I reselect "Event" and save. I don't fancy having todo this for more than 200 resources.

I have tried clearing my cache. Any thoughts?

Toggle Sets with required fields

I have a TV with 3 toggle sets. One of the non selected toggle sets has required fields, which means the resource won't save unless the non selected toggle set TV's are completed.

Is there any way around this?

ToggleTVSet Upgrade broke TVs

Hello,

After upgrading to ToggleTVSet 1.2.1-pl, the first TV that we created using ToggleTVSet works fine, however, all other TVs using ToggleTVSet are broken. When using the single select TV, the proper TV fields associated with the single select TV choice do not display. No fields display and the user is left with a blank screen.

TV's are not hidden on page load in Manager

Hi,

version: 1.2.2-pl
php: 5.3.29

core/components/toggletvset/model/toggletvset/toggletvset.class.php, line 98 and line 115

After this line $hidetvs = array_unique($hidetvs); json_encode($hidetvs) returns an associative array.
The javascript snippet appended to <head> then prints the wrong values and all tv's are visible regardless of the selection.

$hidetvs = array_values(array_unique($hidetvs)); fixes it.

getTVLabel empty variable(s) cause error

Hello,

When using ToggleTVSet and pdoTools packages on the same site, the following error occurs when trying to view the site:

Fatal error: Call to a member function get() on a non-object in /home/cms/modx-cores/pdotools/cache/pdotools/includes/elements/modsnippet/39.include.cache.php on line 18

We believe this to be due to the fact that one or more of the variables used in the "getTVLabel" are empty. In order to solve this, we altered the code by adding the following if !empty statements (see attached file).
getTVLabel-updatedSnippet.txt

Could this, or something similar, be adjusted within the package in order to ensure that the error mentioned above goes away?

Thanks!

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.