hev45 Posted July 21, 2022 Share Posted July 21, 2022 Hi, I've been given a colour selector app (that was developed for a traditional website) to include on a Squarespace site. It changes the colour of different parts of an image based on a visitor's selection. It's set up in a hierarchy of folders. Is it possible to add these folders to Squarespace as they are, to be referenced from a code block? Or will I need to get the developer to adjust the app. Thanks in advance for your thoughts on this. Matt Link to comment
paul2009 Posted July 21, 2022 Share Posted July 21, 2022 It will be impossible to answer this without seeing the code working. About me: I'm Paul, a SQSP user for over 18 yrs and a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL, providing high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji below. Buying a coffee is optional. Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance. Link to comment
hev45 Posted July 21, 2022 Author Share Posted July 21, 2022 Hi Paul, The top level code looks like this - function mpi_apt_cs_init_script() { wp_register_style( 'mpi-apt-cs', plugins_url( 'assets/css/main.css', __FILE__ ), array(), '2.0.2', 'all'); wp_enqueue_style( 'mpi-apt-cs' ); my_jquery_enqueue(); wp_enqueue_script( 'mpi-color-selector-2-js', plugins_url('assets/js/main.js', __FILE__ ), array(), '2.0.2', false); } function mpi_apt_cs_dequeue_styles() { wp_dequeue_style( 'mpi-css' ); wp_deregister_style( 'mpi-css' ); } function mpi_apt_cs_dequeue_scripts() { wp_dequeue_script( 'mpi-color-selector-js' ); } function mpi_apt_cs() { ob_start(); require_once(plugin_dir_path( __FILE__ ) . 'views/main.php'); return ob_get_clean(); } function my_jquery_enqueue() { wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js", false, null); wp_enqueue_script('jquery'); } add_action('wp_enqueue_scripts', 'mpi_apt_cs_init_script'); add_action('wp_print_styles', 'mpi_apt_cs_dequeue_styles'); add_action('wp_print_scripts', 'mpi_apt_cs_dequeue_scripts'); add_shortcode('mpi_apt_cs', 'mpi_apt_cs'); define('MPI_APT_CS_PLUGIN_URL', plugin_dir_url( __FILE__ )); define('MPI_APT_CS_PLUGIN_DIR', plugin_dir_path( __FILE__ )); ?> Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment