Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    1. Home
    2. Daniel Mulroy
    3. Best
    • Profile
    • Following 1
    • Followers 2
    • Topics 56
    • Posts 271
    • Best 82
    • Groups 0

    Best posts made by Daniel Mulroy

    • Blog Search Box

      Hello everyone - I've made my own search box and I'm sharing the code here.

      Features:
      Searches your blog title and subtitles for the user inputted keywords. If it matches the title, return it. If it matches the sub title (meta description) of the blog post, label it with a special indicatory, like "(related)".

      Automatically opens a new tab towards that blog post when selected.

      Demo:
      https://www.visigo.fr/blogsearch.html

      Three steps:

      Step 1 (Setup):

      a) Add a simple "Searchable List" component to your page.
      Screen Shot 2020-11-30 at 10.31.03 PM.png

      b) Give that Searchable List component an identifier (I recommend "blog-search" - you will have less settings to change later)
      Screen Shot 2020-11-30 at 10.35.34 PM.png

      c) Add a "jQuery Source Code" object to your page.
      Screen Shot 2020-11-30 at 10.33.56 PM.png

      d) Add some blog posts if you don't have any:)

      Step 2:
      Open the jQuery Source Code, replace EVERYTHING by pasting this code.
      You MUST modify the first two parameters or else it will not work. You must also modify the BLOG_SEARCH_SELECTOR and BLOG_SEARCH_LANGUAGE to reflect your actual use case.

      Step 3:
      Save your page, load it up and try it out!

      If you want to change the action taken after the user selects an option, modify line ~48 "window.open(data.url)" and change it to whatever you'd like.

      Additional info:

      • This does not allow you to search categories or tags. This could theoretically be implemented, but I'd need your help to understand the best use cases.

      • Accented characters:
        I've decided to disregard accented characters when making the comparison. This is to allow people to choose how they search for topics, especially if they are searching in a language that is not the default one on their keyboard. The details of how this is processed is in the removeDiacritics function.

      • FYI, AppDrag's blog API returns the results in this format, which you can access using the data variable returned after user selection:

      {
                  "id": "9", // Integer of the blog post ID number
                  "appID": "your-app-id",
                  "title": "The Title of your Blog Post",
                  "subTitle": "The meta description of your Blog Post",
                  "imageUrl": "uploads/url-of-your-blog-photo",
                  "tags": "blog-post-tags",
                  "category": "[\"4\",\"5\"]", // Blog post categories as JSON stringified array
                  "author": "John Doe",
                  "nbReads": "152",
                  "previewID": "b2b6bxd2-exxe-480c-abf4-a2908s2b4829", // GUID of blog preview ID
                  "totalRead": "152",
                  "isPublished": "True",
                  "PublishDate": "2020-10-20 09:34:05",
                  "formattedDate": "20 octobre, 2020",
                  "lastUpdate": "2020-08-31 13:56:39"
              }
      
      posted in How-to
      Daniel Mulroy
      Daniel Mulroy
    • RE: AppDrag Security

      Hi Dick,

      (Disclaimer, I'm not an AppDrag representative, just a user and fan, but my opinions are my own)

      The AppDrag Whitepaper has some good information about their own security.

      But, part of the AppDrag's power in allowing you to design and build your own 'back-end' to a site is giving you the flexibility how much (or how little) security you need.

      In this sense, it's almost as if you are renting a storefront in a mall. The mall (AppDrag) mops the floors, maintains the public restrooms, manages the parking lot, etc.

      But you have to decide what kind of door and what kind of locks you put on or in your store.

      AppDrag prevents 'unauthorized' access in the default state. Meaning, nobody can change your website or access your data directly.

      However, as soon as you start using their tools to build other ways of accessing the data, the responsibility for security falls under your scope.

      For example, if you build an API function to access confidential or private data, you should also build-in tests or checks to ensure that the API caller is authorized to access that information.

      This is obviously part of a much larger conversation about application security in general, but I wanted to get the ball started by defining and distinguishing the 'scopes' of your responsibility vs. AppDrag's.

      posted in General Discussion
      Daniel Mulroy
      Daniel Mulroy
    • RE: Slow loading blog

      Hi Julien,

      By using Chrome inspector / dev tools, it looks like your page is loading the same script from heyoliver 14 times! And each time it is taking between 2-6 seconds.

      See screenshots here:

      Screen Shot 2020-12-26 at 6.52.50 PM.jpg

      posted in Cloud CMS (Pagebuilder
      Daniel Mulroy
      Daniel Mulroy
    • RE: Upload Laravel App

      Hi Evan,

      I'm not with the @App-Drag team, nor am I a Laravel expert... but a quick check shows that Laravel is a PHP framework. AppDrag is a platform that hosts static HTML/JS/CSS files (+their API and DB backend, of course), but they do not support PHP.

      So, the short answer is no, I do not believe AppDrag would be compatible with an existing Laravel project, unfortunately.

      posted in How-to
      Daniel Mulroy
      Daniel Mulroy
    • RE: Sending html mail from API

      @Wassim said in Sending html mail from API:

      https://stackoverflow.com/questions/41412512/node-js-promise-request-return

      @Dick-Honing I've used the package 'request-promise-native' which allows you to await a request.

      I recommend checking it out, it's been working great for me:
      https://www.npmjs.com/package/request-promise-native

      posted in General Discussion
      Daniel Mulroy
      Daniel Mulroy
    • [Tutorial] Alternate Blog Article listing layout

      Hello all,

      My team asked me to figure out how to alternate the layout of the blog posts, so the image would go between being on the right, then the left.... and I wanted to share the code!

      Before:
      Screen Shot 2021-04-07 at 3.57.43 PM.png

      After:
      Screen Shot 2021-04-07 at 3.57.39 PM.png

      Steps:

      1. On the Blog Listing page, add a "CSS Source Code embedded object" above or below the Blog Listing element.
        alt text
      2. Copy/Paste the following into the CSS Source Code you just added (double click to open):

      Code:
      NOTE: This assumes you don't have any existing padding or margins set on your images or text div's.

          .appdrag-blog-listing .row {
              flex-flow: row;
          }
          
          .appdrag-blog-listing .row:first-child {
              /* Keeps the margin consistent between text and image */
              margin-right: 80px;
          }
          
          .blog-article-container:first-child .blog-article .row {
              /* Needed because the clearfix div messes with the :nth-child count */
              flex-flow: row-reverse;
          }
          
          .blog-article-container:not(.clearfix):nth-child(even) .blog-article .row {
              /* reverse even-numbered blog posts */
              flex-flow: row-reverse;
          }
      
      posted in Cloud CMS (Pagebuilder
      Daniel Mulroy
      Daniel Mulroy
    • RE: What is AI, PK, UQ when creating new column?

      Hello Thomas!

      These are SQL parameters.

      AI: Auto Increments the field on each new insertion
      PK: Primary Key - this is the field that will be used when doing joins (like linked fields)
      UQ: Unique - the SQL operation will fail it would cause two rows to have the same value in this column. This is best used for things like social security numbers, customer id numbers, and other things that are VERY IMPORTANT never to have conflict or duplicated.

      Hope this helps!

      @Wassim-Samad or @Joseph-Benguira, it'd be really nice to have these as tooltips.

      posted in Cloud Backend (Cloud DB
      Daniel Mulroy
      Daniel Mulroy
    • RE: Retrieve visitor country code?

      In case you haven't found this out yourself yet, you can access it from within a CloudBackend function using:

      event["HEADERS"]["CloudFront-Viewer-Country"]
      

      Hope this helps!

      posted in Cloud Backend (Cloud DB
      Daniel Mulroy
      Daniel Mulroy
    • RE: Is the AppDrag function name (or URL?) available from within an API Function?

      @Wassim said in Is the AppDrag function name (or URL?) available from within an API Function?:

      Seems a very good and practical way to do it. You can also manually define it in your API functions while setting sentry up no?

      Yes, I could, but I'm looking for reusable / template code I can copy/paste very quickly between functions and/or use in my template library... so I don't want to think about it each time, just want it to work every time 🙂

      For reference, here's my final code to get the function name both during testing "Try" in CloudBackend and also when the function is called 'normally':

      module.exports.getFunctionInfo = (event, context) => {
          let fInfo = {};
      
          // Try to extrapolate function info
      // sometimes the from-url is not available, so wrapping this in a try/catch block
          try {
              const httpMethods = ["GET", "POST", "PUT", "DELETE", "PATCH"];
              var functionHandle = event.HEADERS['from-url'].split('/').slice(-1)[0]; // Get from URL if it's been called from the web
              for (let method of httpMethods) { // Get from parameters if it's been called from "Try" method, because above method will not work. Could also ignore errors if running from Try Now as they are likely development errors....
                  if (event[method] && event[method].APPDRAG_FUNCTION_NAME != null) functionHandle = event[method].APPDRAG_FUNCTION_NAME;
              }
              fInfo.functionHandle = functionHandle;
          } catch (e) {
              fInfo.functionHandle = "";
          }
      
          fInfo.functionVersion = context.functionVersion;
          fInfo.functionName = context.functionName;
          return fInfo;
      };
      
      posted in Cloud Backend (Cloud DB
      Daniel Mulroy
      Daniel Mulroy
    • Tooltip/Explanation for response types

      Can we have more information (ideally, baked into the UI 🙂 about the response types for Cloud Backend functions?

      Screen Shot 2020-07-17 at 09.49.41.png

      posted in Features requests
      Daniel Mulroy
      Daniel Mulroy
    • RE: Form redirect

      Great Question!

      I have an answer for you. There a few different ways of doing it, but this is what I thought might be simplest. 3 easy steps!

      1. Select your dropdown element and open the paintbrush. Go to "Identification" at the bottom and give it the ID of "service_selector"
      Screen Shot 2021-03-15 at 7.06.24 PM.png

      2. Again on the dropdown element, modify each of your options so that their "Placeholder" remains the same, but the 'Value' becomes the name of the page you want to redirect to (the part that would appear in the URL).

      For example, for the page "https://www.1010media.sg/stocklibrary.html", you would enter "stocklibrary.html"

      Screen Shot 2021-03-15 at 7.12.36 PM.png

      3. On your 'Send' button, click Action -> Javascript, and paste the following one line of code and save:

      window.location.href = "/"+$("#service_selector select")[0].value;
      

      That's it! That one line of Javascript will get the 'value' of the option selected, which corresponds to the filename you want them to visit. Then, it tells the browser to navigate to that page. I love when things are simple and easy 🙂

      Good luck, let us know if you need any more help.

      posted in How-to
      Daniel Mulroy
      Daniel Mulroy
    • RE: store() function

      Brilliant, thank you!

      posted in Cloud CMS (Pagebuilder
      Daniel Mulroy
      Daniel Mulroy
    • [Bug] CloudDB -> Sharing with Edit permissions, unable to add row

      Hello team,

      When sharing DB access with others, unfortunately these people can see all data and edit any field, but they are not able to add any records.

      When attempting to add a record, they get a message that it was successful, but the record is never created.

      Screenshot 2020-07-15 16.38.10.png

      Thank you!

      posted in Cloud Backend (Cloud DB
      Daniel Mulroy
      Daniel Mulroy
    • Subscription Billing

      Hello team-

      We'd love a way to process recurrent transactions.

      Is there a way to do this with your existing shop API and our own billing logic CloudBackend?

      If not, feature request please!

      posted in Features requests
      Daniel Mulroy
      Daniel Mulroy
    • RE: Membership feature

      Hi Bogdan,

      There is a tutorial to do exactly this here:

      Create an authentication system and a private client area.
      https://academy.appdrag.com/FullStack-with-cloud-backend-Episode-2.html

      Create account, improve auth process with token based security.
      https://academy.appdrag.com/FullStack-with-cloud-backend-Episode-3.html

      posted in Cloud CMS (Pagebuilder
      Daniel Mulroy
      Daniel Mulroy
    • High Volume Email sending - rate limiting? Queueing?

      Hello team,

      I'm writing a CloudBackend function to send a high volume of emails (about 1850 in the space of a few minutes).

      My function successfully calls and gets a resolved promise from the cloudBackend.sendEmail function.... but the emails can sometimes take 20, 30 minutes to arrive.

      This was confusing during testing, as I re-launched the sends after tweaking the code, and ended up with many, many, many emails in my test inbox 🙂

      Can you please tell me what kind of throughput I should expect from the .sendEmail function? How can I be sure that it will send (am I guaranteed a send attempt if the .sendEmail promise returns resolved?)

      Daniel

      posted in Cloud Backend (Cloud DB
      Daniel Mulroy
      Daniel Mulroy
    • RE: Instruction on additional authentication features

      Hi Dick,

      I have a 2FA system set up for my backend.

      The way I've done it is: IF you have a table for Users already, when they attempt to first log in, generate a random 2FA code and UPDATE their User record by adding that newly generated token to a column dedicated to it.

      Bonus points if you add a timestamp.

      Then, email/SMS them the 2FA code.

      When they submit it again as part of the second authentication step, you do a SQL SELECT

      like

      SELECT * FROM Users where email = (their email address they submitted) AND 2FAtoken = (2FAtoken they're submitting)
      

      If you implemented the timestamping, you can also modify your SQL query to include only results within the last 5 minutes or whatever you choose.

      If that SELECT statement returns empty, the code is incorrect or expired. If it returns an object, you're good, and you can authenticate the user, set their token, whatever.

      Good luck!

      posted in Features requests
      Daniel Mulroy
      Daniel Mulroy
    • RE: How to instal a font on my Pagebuilder ?

      Hi Maxime,

      You can upload custom fonts from the Asset Manager, but PageBuilder already allows you to install Google Fonts very easily.

      Screen Shot 2020-10-14 at 11.40.52 AM.png

      Also instructions here:
      https://appdrag.com/blog/3-Upload-your-own-fonts.html

      posted in Cloud CMS (Pagebuilder
      Daniel Mulroy
      Daniel Mulroy
    • RE: how do I switch back to that pretty cards preview on the template db folder?

      Hey @Linda-MacDonald 🙂

      I agree, the CloudDB feature is AMAZING!

      You can't switch an existing view to/from card view... you have to create a card view for your data.... then you can switch TO that view. Does that make sense? You've probably already done this if you saw your data as cards already.

      Click the binoculars in the upper left corner, and card type views are shown by this little icon Screen Shot 2020-08-15 at 3.02.00 PM.png

      If you don't see one, create a view for it using the option at the bottom of the drop-down.

      Cheers!

      posted in Cloud Backend (Cloud DB
      Daniel Mulroy
      Daniel Mulroy
    • RE: Animated text, change type

      As a quick 'hack', you could use the animated text plugin. Then, open the source code and change

      data-delay="xxxx"
      

      To a big number, like "999999999"

      Then, it will repeat so infrequently that it probably won't be seen.

      Like I said, this is a hack.... but maybe it works for you 🙂

      posted in Cloud CMS (Pagebuilder
      Daniel Mulroy
      Daniel Mulroy