Wordpress "The Events Calendar" editing the month view - javascript

I am working to edit the month view of "The Events Calendar" in Wordpress. I cannot seem to figure out which files contain the relevant markup. The file structure seems to make sense, however, when I edit anything with /month no changes reflect.
The File Structure
Core Plugin Files
.../plugins/the-events-calendar/src/views/
Here we have several folders with the different views. One of which is "month" and, according to the documentation, contains the files I wish to edit.
Theme Files
.../mytheme/tribe-events/
This is the folder the documentation told me to create to place edited templates in.
The Fubar
When i follow the documentation for editing a single event located in /list everything works as expected. All I need to do is create a subfolder in mytheme/tribe-events/list and put a new file within to override the original.
When I repeat these same steps in order to edit a file within /month view things are different. For some reason none of my changes work. Outside of the /month folder in /views there is a month.php file which contains the following...
do_action( 'tribe_events_before_template' );
// Title Bar
tribe_get_template_part( 'month/title-bar' );
// Tribe Bar
tribe_get_template_part( 'modules/bar' );
// - My Custom Code -
write_log('This Log Works');
// Main Events Content
tribe_get_template_part( 'month/content' );
do_action( 'tribe_events_after_template' );
Note: write_log() is a function I use in php for debugging. It's essentially a console.log but appends the data to the end of the error.log file which i have being read by a terminal. I do not believe the issue is with this function as I have tested other methods.
The "month" file echoes my log just fine. However, when I add the same log into any of the files it is pulling from the 'month/' directory I get nothing. I went through every file in the subdirectories and added a log and realized that they all work except any file within /month
I thought maybe the issue was with the plugins' "tribe_get_template_part()" function pointing to the wrong place so I decided to eliminate the "am i making this child plugin right" variables and just start editing the plugin files directly. But I get the exact same behavior. I got so desperate that I deleted the entire /months folder from the plugin and the calendar still worked!
So obviously I am really missing something but currently I am at a loss.
This documentation is what I've been following to figure this out.
https://support.theeventscalendar.com/153124-Themers-Guide
The only thing I can think of at this point is that the javascript templating system built into the plugin is working some hidden magic but the fact that I can delete the entire months folder leaves me at a loss.

For anyone struggling with this still, I also had the same issue and solved it by disabling the Month View Cache under Event Settings > Display. Screenshot:

Related

VS2015: Prevent download of dynamically generated JavaScript reference by "JavaScript Language Service"

Please see the below image.. note the timestamps -- my computer does not like this activity. This problem seems to happen whenever I have any *.js or *.cshtml file open.
I have turned off "Download remote references (e.g. http://) for files in the miscellaneous files project" in JavaScript -> IntelliSense -> General, but the problem continues.
I also tried moving the inclusion of "doorbell.io.js" into a bundle rather than the _Layout.cshtml file, but that didn't work.
How can I prevent VS from downloading this JavaScript reference?
To fix the immediate issue
Remove the offending line from "_references.js". Save. The problem should stop immediately.
/// <reference path="doorbell.io.js" />
Future considerations...
Note that by default references are set to auto-sync. This means that if you ever refresh your sources, such as from nuget or by adding a javascript file manually, the offending file could be added back in. You can disable this functionality by right-clicking inside the file and unselecting Auto-sync JavaScript References
If you decide to disable this feature, you can still manually update them with the Update JavaScript References menu item.
Note that at this point in time there is no easy way to prevent a specific file from re-appearing on this list. You will need to remove it manually every time Visual Studio generates this list on your behalf.
Firebase Auth Does the Same Thing
I had a hard time solving this for my application when I switched from 2013 to 2015.
I'm using firebase/angular and any file that referenced my Auth service caused this loop. What ended up solving it was adding this registry item as a DWORD with a value of 0: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\JavaScriptLanguageService\MaximumScriptLoaderReferencesToLoad
All credit goes to Michael Braude with Firebase from this SO: Here

Cant adding JS file, or any other, to a Titanium project folder

So i am making a mobile app. in this app, on my main screen, i have a button that when clicked it will load another frame, or js file. this i know how to do but when pressing the button it gives me an error, "cant find file". after 3 hours of web searching i have tried changing the path names to every possible combination and moveing the file around. after doing so i came to realize that next to the new file i created, or any new file i create, there is an "*" and a question mark. for example if i make a new file called login.js it will show up on the explorer window as *?login.js, where the question mark is much smaller symbol. Is there a manifest i must add it to, like in netbeans, because it seems as if there is an error in the file but it is empty.
function signup(e){
var menu = Ti.UI.createWindow({
url: 'Main-Menu.js'
});
menu.open();
}
i also did: Titanium.include('/controllers/Main-Menu.js');
but always getting the same error, the JS file is in my apps controller folder.
This *? indication comes from the git plugin that is shipped with Titanium Studio. It indicates that the file is not commited.
To answer your "can't find file" - question, I need to know some more details about your environment (target platform, sdk version, example code, ...)

Adding javascript to head of Joomla website

I have gone through some Joomla tutorials and I am not understanding how Joomla works. I have never encountered something where every aspect of it evades me. I'm not asking for a free ride.. just where to go or a basic idea of how this works.
I simply need to add a Panoramio javascript into the <head></head> section of a joomla website. In Word Press I simply download the header.php template and code away.
It's so confusing understanding Joomla. I do know not to paste directly into an "Article" page so do I have to install some sort of extension or tool to even get this to work?
I read to edit the index.php in my templates but I can't even find that. Am I the only person that can't understand Joomla at all? Even the beginner documentation seems to assume I know their system. Thank you in advance.
Be careful about which files you add code to. Editing core files like the index.php in the templates folder might not be the best solution. What if there is a template update? The file will get overridden. So just bare that in mind.
Before you add the script, it is good idea to get the name of current template:
$app = JFactory::getApplication();
$template = $app->getTemplate();
You can use the following to import a .js file the <head> tags:
$doc = JFactory::getDocument(); //only include if not already included
$doc->addScript(JUri::root() . 'templates/' . $template . '/file.js');
or you can add the Javascript there and then like so:
$doc = JFactory::getDocument();
$js = "
//javascript goes here
";
$doc->addScriptDeclaration($js);
Hope this helps
you can edit index.php file and other template files as css etc.
go to : Extensions->template manager
chose template TAB
Second from the left you see: "template name" Details and Files
here you can edit any template file directly on your server.
Menu can change depending on Joomla version, but that's the general idea.
You definitely aren't the only one. Joomla is meant to be able to handle anything you need it to do, and this makes it rather complicated.
Your best bet is to add the script to the template index.php file that you mentioned if you want it to be available throughout the entire site. If you just needed it for a particular module or component, you would instead want to load it there. In your case, since you are fairly new to Joomla, let's just get it loading!
Navigate to your base Joomla directory (where you installed Joomla) and look for the templates folder. Within this you should have several folders. Hopefully you know which template you are currently using and open that folder and there should be an index.php file in it. The top of this file should look similar to the header.php file from Wordpress. Add your script tag to the header element and it should load.
If you have no idea what the name of your current template is, go to Extensions->Template Manager on the backend. There should be two with stars to the right of them. One should be marked "administrator" and the other "site". The folder that you are looking for in the templates folder should match the name of the "site" template.
Here is a quick tutorial on what you need to do:
Joomla! templates are at the /templates folder (locate your template)
inside you find the index.php file (there you need to change stuff)
inside you will find a html page with some PHP inside it
locate the <head> tag
How add this:
$doc->addScript($this->baseurl.'/templates/'.$this->template.'/javascript/YOURSCRIPT.js', 'text/javascript');
Make sure that this line of code already exists:
$doc = JFactory::getDocument();
Footnote: Because you did not specifiy what Joomla! version you are using, this example is from Joomla! 2.5, the current LTS.
P.S. You can also insert the script the 'normal' way, after the <head> tag.
I am no expert in JavaScript but I have an AJAX application that works perfectly without modifying any template files. The thing is that it adds the JavaScript at the bottom of the page, not in the head section. I don't know if this is an issue but it works for me.
1) Go to Extensions->Module Manager
2) Create a new module. Call it JavaScript Footer (for example)
3) Under the Details tab set Show Title to Hide, set Position to Debug, set Status to Published and set Access to Public
4) Under the Custom Output tab, type
<script type="text/javascript" src="http://yourdomain.com/yourscript.js"></script>
I never did understand why some scripts are in the header while others are at the bottom of the body (Google Analytics for example) but it works for me.
Joomla is quite different from Wordpress. Actually, index.php is rather useless when customizing joomla template. You will have to explore the blocks of the template in the folder blocks found in your template. For example, to add a scripts in the header section just edit header.php in the directory your_template/blocks.

Extending an extension (SCP) in Magento causes JS errors?

I don't think this is an actual JS error, but the symptoms are JS related. I have a Magento 1.7.0.2 installation with SCP (Simple Configurable Products) which works 100% as I want/expect. In my early development I added some methods to 1 specific file in the SCP module, app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Configurable.php.
With these methods inside of the SCP module everything works, however I realise now I really should have created an additional module in the local code pool that extends SCP and put my additional methods in there. So I created Bendart_Matrix. I cut the 3 methods out of SCP's Configurable.php and placed them in my own module, app/code/local/Bendart/Matrix/Catalog/Model/Product/Type/Configurable.php. Whilst the page still loads, there appear to be some JS errors which ultimately relate to the Product JS Object not being created correctly. It doesn't get created with the .Options method like it does when my methods are part of SCP.
I can't find a logical reason as to why this is, so I've created some gists of my module (Configurable.php, config.xml and Bendart_Matrix.xml) and the same files from SCP. Once again, if I disable or remove my module and switch the methods back to SCP files, it works. Weird?
SCP config.xml: https://gist.github.com/4327015
SCP Module Declaration XML: https://gist.github.com/4327012
SCP Configurable.php (minus the methods from my file: https://gist.github.com/4326996
My config.xml: https://gist.github.com/4326988
My Module Declaration XML: https://gist.github.com/4326986
My Configurable.php (just the methods in question): https://gist.github.com/4326909
Any help or advice is appreciated as I want to do it properly and remove my methods from the SCP module but there appears to be some dependencies I've missed or something?
Based on the information you posted, I think the most likely issue is going to be that you have made a change in your layout update that removes a template that is required. You seem to be extending the module correctly and a JS error in generally related to templates in this situation.
P.S. Slight heads up, came to our attention this morning that SCP doesn't function correctly if somebody adds a configurable product to their basket from the Wishlist page (it adds both the configurable and the simple, this may not matter to you, but with our customised exports and adminhtml updates this caused issues). If you have Wishlist enabled you should bare this in mind.
Ok, I've fixed one issue thanks to #Cags.
I noticed whilst turning template hints on that scpoptions.phtml wasn't being included in comparison to my live working version. I added the following lines (taken from simpleconfigurableproducts.xml)
<reference name="product.info.options">
<action method="setTemplate"><template>catalog/product/view/scpoptions.phtml</template></action>
</reference>
This fixed all the JS warnings about Product.Options and any other warnings I had. It also ensured that the product price was updated correctly once I started selecting custom options etc.
Now, one last issue, when I load the product page, before I select ANYTHING, the price shows as 0.00. As soon as I select a drop-down the price "kicks in" and it works from there on in, it just appears to be the initial page load. I've compared template files with my live site that works (but doesn't have my module) so again it's something to do with the inclusion of my module, but what?
Cheers.

Using Components.utils.import in a firefox extension

I am trying to create some global variables in a firefox extension. In my content folder, I have two javascript files:
1) Main JS file that holds the functions for the different events, etc
2) A file that stores only an object with the pieces of state I want to maintain. Also, I set the array EXPORTED_SYMBOLS.
I am having issues with the following line found in my main JS file:
Components.utils.import("resource:///globalVariables.js");
When it is at the top of the file, nothing seems to work. If I move it into the function where I need the variable, the rest of my code works, but the function with this line does nothing. Any advice that would help me with this problem would be great. Thanks
Chances are resource:///globalVariables.js is not the right URI. Make sure you register it properly, and include the aliasname when you reference it.

Categories