Jump to content

Adding a colour selector app - can hierarchy of folders be uploaded to SQSP?

Recommended Posts

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
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

It will be impossible to answer this without seeing the code working. 

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.