Piranha CMS: Problem with custom block in manager interface - piranha-cms

I am trying to add a custom block. I followed the steps in following two links:
http://piranhacms.org/docs/extensions/blocks
and
http://piranhacms.org/docs/manager-extensions/resources
In the CMS manager, I added the custom block to a page, but the block content is empty. Looks like the Vue.js didn't get associated to the custom block. I have set the block component attribute to the Vue.js.
I added the Vue.js by calling below method in the startup. Did I miss something to create a custom block?
App.Modules.Get<Piranha.Manager.Module>().Scripts.Add("~/assets/js/myscripts.js");

Move your "mycustomblock.js" file to the folder "wwwroot/js/" instead of the default "assets/js/". That way the file will be visible to Vue.js
Something is not working with the assets folder, probably it cannot be reached by Vue.js
after the Project is compiled. I had the same problem and this solution worked for me.
void Configure in Startup.cs will then look something like this (I simplified the syntax a bit compared to the documentation):
App.Modules.Manager().Scripts.Add("~/js/mycustomblock.js");
Adding a custom block and many other tasks have been difficult for me. Trial and error, and no knowledgebase to fall back on. The documentation is a fantastic start, and "Step by step" guides would be a good idea for the future (but I guess time is very limited).

Related

Vue: Showing that the function does not exist when I have defined it the relevant store

I am currently working on a simple app to store workout routines in Nuxt 3 and Appwrite. The link to the source code is here.
After logging in and adding in some workouts in the app's UI, whenever I try to call the deleteWorkout function, I get an error in the console saying that the function is not defined, whereas I have clearly defined in the workoutStore. I can't seem to figure out the reason for the same.
The same can be seen in the given screenshot.
Console on clicking the delete button
PS:
Most probably the error should be originating from either /pages/workouts.vue, /components/WorkoutDetails.vue or /stores/workout.js.
I am using Appwrite to manage the back-end of the web app, and the instructions to setup the same can be found in the README.md. (Though I don't think the error I am facing is related to the same.)
In your code the problem is, you declear your deleteWorkout() function outside of the actions block in workout.js file.
Make sure all your functions in the workout store are inside the actions block. Then it will be accessable from the vue component

What is the origin of $generalUtil in my atlassian-plugin.xml?

I'm studying the code of a custom Confluence plugin, which contains an atlassian-plugin.xml file that includes references to two variables $generalUtil and $helper, but I find no definitions of them whatsoever in the entire project. They simply work and it appears to me that they are magically instantiated out of thin air.
<web-item key="configtab" name="configtab" section="system.space.tools/addons">
<label key="myplugin.space.tools.addons.tab.label" />
<link>/spaces/myplugin-config.action?spaceKey=$generalUtil.urlEncode($helper.spaceKey)</link>
</web-item>
The $generalUtil must be an instance of com.atlassian.confluence.util.GeneralUtil, which also has a method urlEncode(). But where does this variable originate from?
What puzzles me even more is the $helper, which has a spaceKey field/method that I find in the code, but without any relationship to any kind of Helper class. The $helper also appears in a velocity template, but also without any definition of it. Any ideas where this stuff is documented?
generalUtil is documented here: https://docs.atlassian.com/ConfluenceServer/javadoc/7.11.6/
I think helper is https://docs.atlassian.com/ConfluenceServer/javadoc/7.11.6/com/atlassian/confluence/themes/GlobalHelper.html
They are injected into the Velocity context used to render that link.

Minecraft Modding Using Forge: GradleStart is in default package?

My project runs, and I see my mod populating within Minecraft, but for some reason my code doesn't do anything. I followed a basic tutorial that should be adding an item with a texture. I also set some basic method as such within Main to test whether this is working or not:
public void onPlayerTick(TickEvent.PlayerTickEvent tick)
{
System.out.println("testing 123");
}
Upon loading of the world, this doesn't output anything.
Any help?
I think it's working now. I made the dev environment again, this time with a different tutorial from the beginning. The main difference was this tutorial used intellij like me, unlike the other tutorial which used eclipse. Seems to be working because something in the init method printed out something in the format that is expected in the console (meaning it is compiling and using the code properly). So it appears to be working... It seems. I used these tutorials, they were very in depth, would recommend regardless. This is the playlist: https://www.youtube.com/playlist?list=PLxZiPYkNuhkQKH-QlM0C_3-LvjbQA8ZAu

Can add my own custom snippets to Big Commerce

I have tried to upload my own snippet that replaces the create new account text that is held in the %%LNG_NewCustomerIntro2%% variable. Of course I am thinking this would be as simple as 123 but I guess not.
Does a snippet have to be registered? Or should I just comment out the current code in the snippet I need (or hide it with css) and then add in my code?
It seems this is common with bigcommerce....
Any suggestions
No, you can not introduce custom snippets to BigCommerce. Snippets refer to a function in the core application to supply data (thus requiring core code). It is better to remove the existing snippet and provide your own code within the panel or layout file.

how begin with appcelerator for desktop (and use the API's)

I've a bit experience with qt+ and creating not so complex web pages, but I don't know how begin with titanium...when I run the default app this work...I can change the index.html like a web page...I can include javascript code and jquery too...very nice...but when I try run api functions I don't know how include these...all examples talk about iphone and a app.js file...I'm trying make a desktop app and don't appear any .js...I can create these but don't work
...in the docs I read things like these:
var win = Ti.UI.createWindow(); var view = Ti.UI.createView({backgroundColor:"red"}); win.add(view); win.open();
I don't know where I've put this code...I try put it inside a javascript inside the html (bad practice!) but it don't work...I put it inside a function onload but don't work neither.....there are any "convention" with the names for the files for this work?...I think this is like create a very dynamic web page but I don't know how work with the api....I see the example "kitchen something" but it wasn't so clear to mee...I see a examples like this:
http://mobile.tutsplus.com/tutorials/appcelerator/appcelerator-using-json-to-build-a-twitter-client/
but seems this work different when is an ipod to when it is a desktp app...I create an app.js (like the tuto) and put my code inside it but it never run...I look the source code and only need create a .js and inside my "home.html" link it..but it don't work...I create a index.js too but it don't work neither
please help..I'm very noob...thanks
Aaron:
This reply kindly brought something that could have been a solution but just made me lose more than 15 minutes of my time, as these first online courses have info about how to create a new project with a default html file, not about the original poster's issue.
The original poster's issue is that he has a new project with an index.html file, but no app.js file.
And he then doesn't understand where he could put the sampe code :
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({backgroundColor:"red"});
win.add(view);
win.open();
... as whatever he puts in app.js is not executed.
The documentation in Titanium Dev Center fails to provide accurate information as it only mentions Titanium Mobile app.js and does not speak of index.html in the application structure.
After some starting experience on Titanium Mobile, I had to work on Titanium Desktop andactually just had the same problem as angel_ang, which brought me here.
So, here is the real answer :
Titanium Desktop applications do not need or start with an app.js file, but with index.html.
Deleting or removing this file never works as it will still be launched from the last build if need be.
Adding anything to app.js will never run as only index.html is run as a starting place.
Something that should have been a solution was found that to the following link:
http://www.youtube.com/watch?v=lgGVNB2nkKc&NR=1
This video is two online courses further from the link supplied by Aaron. At 0.19 seconds exactly, we see the starting code he has added to index.html.
You need to put a ... in your HEAD section, and add a function() there.
You may put the sample code inside this function.
Then you may even set the function to run when you click a button ().
Unfortunately, this doesn't work with me either.
I tried with the example code above but also with the other example (notification) mentioned in the online course.
It just seems that something is deprecated here and many documentations are outdated.
Anyone that could answer to this situation would be very helpful to us and many newcomers.
We just have an index.html that we can't use, instead of a running app.js file.